From d1e017cc5e14faea8cc1d16e6bb5f17d11cbcaf1 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Thu, 4 Oct 2012 13:41:41 -0500 Subject: [PATCH] Fixes console log methods for IE9 --- web/compatibility.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/web/compatibility.js b/web/compatibility.js index 603caaca8..8429a8a65 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -376,7 +376,18 @@ // Check console compatability (function checkConsoleCompatibility() { if (typeof console == 'undefined') { - console = {log: function() {}}; + console = { + log: function() {}, + error: function() {} + }; + } else if (!('bind' in console.log)) { + // native functions in IE9 might not have bind + console.log = (function(fn) { + return function(msg) { return fn(msg); } + })(console.log); + console.error = (function(fn) { + return function(msg) { return fn(msg); } + })(console.error); } })();