[ 
https://issues.apache.org/jira/browse/WEEX-671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702824#comment-16702824
 ] 

ASF GitHub Bot commented on WEEX-671:
-------------------------------------

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:
us...@infra.apache.org


> [iOS] `extendCallNative` method move to instance jscontext
> ----------------------------------------------------------
>
>                 Key: WEEX-671
>                 URL: https://issues.apache.org/jira/browse/WEEX-671
>             Project: Weex
>          Issue Type: Improvement
>            Reporter: Hao Junhua
>            Assignee: Adam Feng
>            Priority: Minor
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to