feat:add InjectEmpty to ignore too much logout

This commit is contained in:
pengfei.zhou
2019-11-26 13:32:07 +08:00
parent 9a9482eeb5
commit 208c635b8b
6 changed files with 15 additions and 2 deletions

View File

@@ -59,7 +59,9 @@ - (void)initJSExecutor {
[self.jsExecutor injectGlobalJSObject:INJECT_LOG obj:^(NSString *type, NSString *message) {
DoricLog(@"JS:%@", message);
}];
[self.jsExecutor injectGlobalJSObject:INJECT_EMPTY obj:^() {
}];
[self.jsExecutor injectGlobalJSObject:INJECT_REQUIRE obj:^(NSString *name) {
__strong typeof(_self) self = _self;
if (!self) return NO;

View File

@@ -32,6 +32,7 @@ extern NSString *const INJECT_REQUIRE;
extern NSString *const INJECT_TIMER_SET;
extern NSString *const INJECT_TIMER_CLEAR;
extern NSString *const INJECT_BRIDGE;
extern NSString *const INJECT_EMPTY;
extern NSString *const TEMPLATE_CONTEXT_CREATE;

View File

@@ -32,6 +32,7 @@
NSString *const INJECT_TIMER_SET = @"nativeSetTimer";
NSString *const INJECT_TIMER_CLEAR = @"nativeClearTimer";
NSString *const INJECT_BRIDGE = @"nativeBridge";
NSString *const INJECT_EMPTY = @"nativeEmpty";
NSString *const TEMPLATE_CONTEXT_CREATE = @"Reflect.apply("
"function(doric,context,Entry,require,exports){" "\n"