- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스) - Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포 - 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53 lines
1.7 KiB
Plaintext
53 lines
1.7 KiB
Plaintext
// Copyright 2023-present 650 Industries. All rights reserved.
|
|
|
|
#import <ExpoModulesCore/EXJSIConversions.h>
|
|
#import <ExpoModulesCore/EXRawJavaScriptFunction.h>
|
|
|
|
@implementation EXRawJavaScriptFunction {
|
|
/**
|
|
Pointer to the `EXJavaScriptRuntime` wrapper.
|
|
|
|
\note It must be weak because only then the original runtime can be safely deallocated
|
|
when the JS engine wants to without unsetting it on each created object.
|
|
*/
|
|
__weak EXJavaScriptRuntime *_runtime;
|
|
|
|
/**
|
|
Shared pointer to the underlying JSI function.
|
|
*/
|
|
std::shared_ptr<jsi::Function> _function;
|
|
}
|
|
|
|
- (nonnull instancetype)initWith:(std::shared_ptr<jsi::Function>)function
|
|
runtime:(nonnull EXJavaScriptRuntime *)runtime
|
|
{
|
|
if (self = [super init]) {
|
|
_runtime = runtime;
|
|
_function = function;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (nonnull EXJavaScriptValue *)callWithArguments:(nonnull NSArray<id> *)arguments
|
|
thisObject:(nullable EXJavaScriptObject *)thisObject
|
|
asConstructor:(BOOL)asConstructor
|
|
{
|
|
jsi::Runtime *runtime = [_runtime get];
|
|
std::vector<jsi::Value> vector = expo::convertNSArrayToStdVector(*runtime, arguments);
|
|
const jsi::Value *data = vector.data();
|
|
jsi::Value result;
|
|
|
|
if (asConstructor) {
|
|
result = _function->callAsConstructor(*runtime, data, arguments.count);
|
|
} else if (thisObject) {
|
|
result = _function->callWithThis(*runtime, *[thisObject get], data, arguments.count);
|
|
} else {
|
|
result = _function->call(*runtime, data, arguments.count);
|
|
}
|
|
|
|
std::shared_ptr<jsi::Value> resultPtr = std::make_shared<jsi::Value>(*runtime, result);
|
|
return [[EXJavaScriptValue alloc] initWithRuntime:_runtime value:resultPtr];
|
|
}
|
|
|
|
@end
|