You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/05/28 20:42:16 UTC
js commit: Add a check for cordova.js being loaded multiple times
Updated Branches:
refs/heads/master 0bca50537 -> 55de99f04
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/master
Commit: 55de99f0481b7034d4c475e6186c67af6da36d25
Parents: 0bca505
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue May 28 14:41:31 2013 -0400
Committer: Andrew Grieve <ag...@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];