feat:add pureCallEntityMethod,avoid hook affects

This commit is contained in:
pengfei.zhou
2021-04-14 16:53:38 +08:00
committed by osborn
parent b762b9db4b
commit 009e8734b6
37 changed files with 266 additions and 209 deletions

View File

@@ -292,6 +292,30 @@ - (DoricAsyncResult *)callJSResponse:(NSString *)funcId, ... {
return ret;
}
- (DoricAsyncResult *)pureCallJSResponse:(NSString *)funcId, ... {
NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:self.doricContext.contextId];
[array addObject:DORIC_ENTITY_RESPONSE];
[array addObject:self.idList];
[array addObject:funcId];
va_list args;
va_start(args, funcId);
id arg;
while ((arg = va_arg(args, id)) != nil) {
[array addObject:arg];
}
DoricAsyncResult *ret = [self.doricContext.driver invokeDoricMethod:DORIC_CONTEXT_INVOKE_PURE argumentsArray:array];
__weak typeof(self) __self = self;
ret.exceptionCallback = ^(NSException *e) {
__strong typeof(__self) self = __self;
[self.doricContext.driver.registry
onException:e
inContext:self.doricContext];
};
va_end(args);
return ret;
}
+ (__kindof DoricViewNode *)create:(DoricContext *)context withType:(NSString *)type {
DoricRegistry *registry = context.driver.registry;
Class clz = [registry acquireViewNode:type];