You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/05/29 02:30:05 UTC

js commit: CB-8468 - Application freezes if breakpoint hits JavaScript callback invoked from native

Repository: cordova-js
Updated Branches:
  refs/heads/master 43c8d6104 -> 796a18d42


CB-8468 - Application freezes if breakpoint hits JavaScript callback invoked from native


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/796a18d4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/796a18d4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/796a18d4

Branch: refs/heads/master
Commit: 796a18d425a03101a1a931c54cd8ea002230067c
Parents: 43c8d61
Author: Shazron Abdullah <sh...@apache.org>
Authored: Thu May 28 17:31:21 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu May 28 17:31:21 2015 -0700

----------------------------------------------------------------------
 src/legacy-exec/ios/exec.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/796a18d4/src/legacy-exec/ios/exec.js
----------------------------------------------------------------------
diff --git a/src/legacy-exec/ios/exec.js b/src/legacy-exec/ios/exec.js
index 856b9b1..11cc92b 100644
--- a/src/legacy-exec/ios/exec.js
+++ b/src/legacy-exec/ios/exec.js
@@ -301,11 +301,19 @@ iOSExec.nativeFetchMessages = function() {
     return json;
 };
 
-iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) {
+iOSExec.nativeCallback = function(callbackId, status, message, keepCallback, debug) {
     return iOSExec.nativeEvalAndFetch(function() {
         var success = status === 0 || status === 1;
         var args = convertMessageToArgsNativeToJs(message);
-        cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
+        function nc2() {
+            cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
+        }
+        // CB-8468
+        if (debug) {
+            setTimeout(nc2, 0);
+        } else {
+            nc2();
+        }
     });
 };
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org