cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [07/13] js commit: Add a check for cordova.js being loaded multiple times
Date Tue, 04 Jun 2013 20:53:03 GMT
Add a check for cordova.js being loaded multiple times


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

Branch: refs/heads/2.8.x
Commit: 55de99f0481b7034d4c475e6186c67af6da36d25
Parents: 0bca505
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue May 28 14:41:31 2013 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue May 28 14:41:31 2013 -0400

----------------------------------------------------------------------
 lib/scripts/bootstrap.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/55de99f0/lib/scripts/bootstrap.js
----------------------------------------------------------------------
diff --git a/lib/scripts/bootstrap.js b/lib/scripts/bootstrap.js
index 31979fa..47c3179 100644
--- a/lib/scripts/bootstrap.js
+++ b/lib/scripts/bootstrap.js
@@ -20,6 +20,11 @@
 */
 
 (function (context) {
+    if (context._cordovaJsLoaded) {
+        throw new Error('cordova.js included multiple times.');
+    }
+    context._cordovaJsLoaded = true;
+
     var channel = require('cordova/channel');
     var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
 


Mime
View raw message