Merge pull request #2196 from yurydelendik/ie9-console

Fixes console log methods for IE9
This commit is contained in:
Brendan Dahl 2012-10-04 15:57:43 -07:00
commit 554231288d

View File

@ -381,7 +381,18 @@
// Check console compatability // Check console compatability
(function checkConsoleCompatibility() { (function checkConsoleCompatibility() {
if (typeof console == 'undefined') { 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);
} }
})(); })();