cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject js commit: [All] patch, in case console.warn is not defined
Date Wed, 10 Jul 2013 01:53:31 GMT
Updated Branches:
  refs/heads/master 0ce471840 -> 984b1f1e2


[All] patch, in case console.warn is not defined


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

Branch: refs/heads/master
Commit: 984b1f1e26b12af2ad2acda96074341853ea8706
Parents: 0ce4718
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Tue Jul 9 18:53:02 2013 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Tue Jul 9 18:53:02 2013 -0700

----------------------------------------------------------------------
 lib/cordova.js | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/984b1f1e/lib/cordova.js
----------------------------------------------------------------------
diff --git a/lib/cordova.js b/lib/cordova.js
index 2bf49ab..0a566bb 100644
--- a/lib/cordova.js
+++ b/lib/cordova.js
@@ -99,10 +99,17 @@ function createEvent(type, data) {
 }
 
 if(typeof window.console === "undefined") {
+    window.external.Notify("console was undefined, in cordova.js fixing it.");
     window.console = {
         log:function(){}
     };
 }
+// there are places in the framework where we call `warn` also, so we should make sure it
exists
+if(typeof window.console.warn === "undefined") {
+    window.console.warn = function(msg) {
+        this.log("warn: " + msg);
+    }
+}
 
 var cordova = {
     define:define,


Mime
View raw message