[android] Fix circular dependency bug with exec() in callback.js.

Fixed by moving require() into function scope.


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/daf2cab2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/daf2cab2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/daf2cab2

Branch: refs/heads/master
Commit: daf2cab2b05c10f5c5a96f86046db61fa8bf16a8
Parents: 9464e6b
Author: Andrew Grieve <agri...@chromium.org>
Authored: Mon Aug 20 11:02:10 2012 -0400
Committer: Andrew Grieve <agri...@chromium.org>
Committed: Mon Aug 20 11:06:38 2012 -0400

----------------------------------------------------------------------
 lib/android/plugin/android/callback.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/daf2cab2/lib/android/plugin/android/callback.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/callback.js 
b/lib/android/plugin/android/callback.js
index 4729678..d17c5ab 100644
--- a/lib/android/plugin/android/callback.js
+++ b/lib/android/plugin/android/callback.js
@@ -1,10 +1,11 @@
 var port = null,
     token = null,
-    exec = require('cordova/exec'),
     xmlhttp;
 
 module.exports = {
     start: function callback() {
+        // cordova/exec depends on this module, so we can't require 
cordova/exec on the module level.
+        var exec = require('cordova/exec'),
         xmlhttp = new XMLHttpRequest();
 
         // Callback function when XMLHttpRequest is ready

Reply via email to