Fixes console log methods for IE9

This commit is contained in:
Yury Delendik 2012-10-04 13:41:41 -05:00
parent bd0e42220b
commit d1e017cc5e

View File

@ -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);
}
})();