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

[GitHub] cxfeng1 closed pull request #1843: [WEEX-671][iOS] `extendCallNative` method move to instance jscontext

cxfeng1 closed pull request #1843: [WEEX-671][iOS] `extendCallNative` method move to instance jscontext
URL: https://github.com/apache/incubator-weex/pull/1843
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
index 0dfe18dd3e..e82917787d 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 @@ + (void)mountContextEnvironment:(JSContext*)context
         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 @@ + (void)handleConsoleOutputWithArgument:(NSArray *)arguments logLevel:(WXLogFlag
         }
     }];
 }
+
++(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 0e7a48d529..f6c5436a92 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm
@@ -427,10 +427,6 @@ - (void)createDefaultContext
     _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 @@ - (void)triggerClearTimeout:(NSString *)ret
     }
 }
 
--(id)extendCallNative:(NSDictionary *)dict
-{
-    if(dict){
-        return [WXExtendCallNativeManager sendExtendCallNativeEvent:dict];
-    }
-    return @(-1);
-}
-
 @end


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services