Workaround for apply missing in IE console (native object vs function)

This commit is contained in:
Thomas Gelf 2014-03-04 13:06:12 +00:00
parent 927b0a7ae7
commit 090974401c

View File

@ -16,3 +16,28 @@
})(Object);
(function (console) {
'use strict';
if ('undefined' === console) {
return;
}
/* Fix console for IE9, TBD: test IE8 */
if (typeof console.log == 'object' && Function.prototype.bind && console) {
[
'log',
'info',
'warn',
'error',
'assert',
'dir',
'clear',
'profile',
'profileEnd'
].forEach(function (method) {
console[method] = this.call(console[method], console);
}, Function.prototype.bind);
}
})(console);