[All] patch, in case console.warn is not defined
(cherry picked from commit 984b1f1e26b12af2ad2acda96074341853ea8706)


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

Branch: refs/heads/2.9.x
Commit: a1ff039ab6e717ac8eae66df96bbcbb5b19aced6
Parents: af01151
Author: Jesse MacFadyen <[email protected]>
Authored: Tue Jul 9 18:53:02 2013 -0700
Committer: Andrew Grieve <[email protected]>
Committed: Tue Oct 22 11:35:26 2013 -0400

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


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a1ff039a/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,

Reply via email to