Updated Branches:
  refs/heads/master 788b2a80e -> 058b400e1

[ios] Fix commandDelegate.evalJs to actually bundle exec() calls.

It was not setting the isInContextOfEvalJs flag before executing
the code before.


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

Branch: refs/heads/master
Commit: 058b400e1b85c3d70f5abdc61b6571a0d64d6d92
Parents: 788b2a8
Author: Andrew Grieve <agri...@chromium.org>
Authored: Wed Oct 10 14:13:32 2012 -0400
Committer: Andrew Grieve <agri...@chromium.org>
Committed: Wed Oct 10 14:13:52 2012 -0400

----------------------------------------------------------------------
 lib/ios/exec.js |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/058b400e/lib/ios/exec.js
----------------------------------------------------------------------
diff --git a/lib/ios/exec.js b/lib/ios/exec.js
index 7c8d136..c6b8edd 100644
--- a/lib/ios/exec.js
+++ b/lib/ios/exec.js
@@ -162,11 +162,17 @@ iOSExec.nativeFetchMessages = function() {
 };
 
 iOSExec.nativeCallback = function(callbackId, status, payload, keepCallback) {
+    return iOSExec.nativeEvalAndFetch(function() {
+        var success = status == 0 || status == 1;
+        cordova.callbackFromNative(callbackId, success, status, payload, 
keepCallback);
+    });
+};
+
+iOSExec.nativeEvalAndFetch = function(func) {
     // This shouldn't be nested, but better to be safe.
     isInContextOfEvalJs++;
     try {
-        var success = status == 0 || status == 1;
-        cordova.callbackFromNative(callbackId, success, status, payload, 
keepCallback);
+        func();
         return iOSExec.nativeFetchMessages();
     } finally {
         isInContextOfEvalJs--;

Reply via email to