You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2018/01/18 08:34:49 UTC

[33/50] [abbrv] incubator-weex git commit: * [iOS] callJS on instanceContext

* [iOS] callJS on instanceContext


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e3a909ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e3a909ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e3a909ee

Branch: refs/heads/master
Commit: e3a909ee354cd9c5e262108edb304aa08d016925
Parents: 7ff0a78
Author: acton393 <zh...@gmail.com>
Authored: Mon Jan 8 19:48:58 2018 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon Jan 8 19:48:58 2018 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e3a909ee/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
index 26b327d..e83fa04 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
@@ -782,7 +782,12 @@ _Pragma("clang diagnostic pop") \
     }
     
     if ([tasks count] > 0 && execIns) {
-        [self callJSMethod:@"callJS" args:@[execIns, tasks]];
+        WXSDKInstance * execInstance = [WXSDKManager instanceForID:execIns];
+        if (execInstance.instanceJavaScriptContext) {
+            [self callJSMethod:@"__WEEX_CALL_JAVASCRIPT__" args:@[execIns, tasks] onContext:execInstance.instanceJavaScriptContext completion:nil];
+        } else {
+            [self callJSMethod:@"callJS" args:@[execIns, tasks]];
+        }
     }
     
     if (hasTask) {