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-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/37113b13 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/37113b13 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/37113b13 Branch: refs/heads/master Commit: 37113b13d016e2533462b8be9b6739898ddf7345 Parents: 7b4014c Author: Andrew Grieve <agri...@chromium.org> Authored: Wed Oct 10 14:12:22 2012 -0400 Committer: Andrew Grieve <agri...@chromium.org> Committed: Wed Oct 10 14:12:22 2012 -0400 ---------------------------------------------------------------------- CordovaLib/Classes/CDVCommandDelegateImpl.m | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/37113b13/CordovaLib/Classes/CDVCommandDelegateImpl.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVCommandDelegateImpl.m b/CordovaLib/Classes/CDVCommandDelegateImpl.m index 806a821..2cdf85f 100644 --- a/CordovaLib/Classes/CDVCommandDelegateImpl.m +++ b/CordovaLib/Classes/CDVCommandDelegateImpl.m @@ -67,7 +67,7 @@ // dead-lock. // If the commandQueue is currently executing, then we know that it is safe to // execute the callback immediately. - // Using dispatch_async(dispatch_get_main_queue()) does *not* fix deadlocks for some reaon, + // Using (dispatch_get_main_queue()) does *not* fix deadlocks for some reaon, // but performSelectorOnMainThread: does. if (![NSThread isMainThread] || !_commandQueue.currentlyExecuting) { [self performSelectorOnMainThread:@selector(evalJsHelper2:) withObject:js waitUntilDone:NO]; @@ -95,7 +95,7 @@ - (void)evalJs:(NSString*)js { - js = [js stringByAppendingString:@";cordova.require('cordova/exec').nativeFetchMessages()"]; + js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeEvalAndFetch(function(){%@})", js]; [self evalJsHelper:js]; }