From 090974401c1745cf0f3939c1df454a0d4b294ac8 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 4 Mar 2014 13:06:12 +0000 Subject: [PATCH] Workaround for apply missing in IE console (native object vs function) --- public/js/helpers.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/public/js/helpers.js b/public/js/helpers.js index 81cecdae9..b889ab26f 100644 --- a/public/js/helpers.js +++ b/public/js/helpers.js @@ -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);