You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2018/11/29 07:57:50 UTC

[incubator-weex] branch master updated: [WEEX-671][iOS] `extendCallNative` method move to instance jscontext (#1843)

This is an automated email from the ASF dual-hosted git repository.

cxfeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 980892a  [WEEX-671][iOS] `extendCallNative` method move to instance jscontext (#1843)
980892a is described below

commit 980892a30f8d798d9af9962f82ca2c99ccd1e7c1
Author: Junhua Hao <38...@qq.com>
AuthorDate: Thu Nov 29 15:57:45 2018 +0800

    [WEEX-671][iOS] `extendCallNative` method move to instance jscontext (#1843)
---
 ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 13 +++++++++++++
 ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm | 12 ------------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
index 0dfe18d..e829177 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
@@ -51,6 +51,7 @@
 #import "WXJSFrameworkLoadProtocol.h"
 #import "WXJSFrameworkLoadDefaultImpl.h"
 #import "WXHandlerFactory.h"
+#import "WXExtendCallNativeManager.h"
 
 #define SuppressPerformSelectorLeakWarning(Stuff) \
 do { \
@@ -1125,6 +1126,10 @@ _Pragma("clang diagnostic pop") \
         NSString * levelStr = [[args lastObject] toString];
         [WXBridgeContext handleConsoleOutputWithArgument:args logLevel:(WXLogFlag)[levelMap[levelStr] integerValue]];
     };
+    
+    context[@"extendCallNative"] = ^(JSValue *value ) {
+        return [WXBridgeContext extendCallNative:[value toDictionary]];
+    };
 }
 
 + (void)handleConsoleOutputWithArgument:(NSArray *)arguments logLevel:(WXLogFlag)logLevel
@@ -1149,4 +1154,12 @@ _Pragma("clang diagnostic pop") \
         }
     }];
 }
+
++(id)extendCallNative:(NSDictionary *)dict
+{
+    if(dict){
+        return [WXExtendCallNativeManager sendExtendCallNativeEvent:dict];
+    }
+    return @(-1);
+}
 @end
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm
index 0e7a48d..f6c5436 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm
@@ -427,10 +427,6 @@
     _jsContext[@"clearTimeoutWeex"] = ^(JSValue *ret) {
         [weakSelf triggerClearTimeout:[ret toString]];
     };
-    
-    _jsContext[@"extendCallNative"] = ^(JSValue *value ) {
-        return [weakSelf extendCallNative:[value toDictionary]];
-    };
 }
 
 -(void)addInstance:(NSString *)instance callback:(NSString *)callback
@@ -545,12 +541,4 @@
     }
 }
 
--(id)extendCallNative:(NSDictionary *)dict
-{
-    if(dict){
-        return [WXExtendCallNativeManager sendExtendCallNativeEvent:dict];
-    }
-    return @(-1);
-}
-
 @end