Skip to content

Commit 9142fb2

Browse files
committed
Fix IE issue with console plugin
Fixes #217
1 parent 2185a95 commit 9142fb2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/console.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ var logForGivenLevel = function(level) {
1919

2020
// this fails for some browsers. :(
2121
if (originalConsoleLevel) {
22-
originalConsoleLevel.apply(originalConsole, args);
22+
// IE9 doesn't allow calling apply on console functions directly
23+
// See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
24+
Function.prototype.bind
25+
.call(originalConsoleLevel, originalConsole)
26+
.apply(originalConsole, args);
2327
}
2428
};
2529
};

0 commit comments

Comments
 (0)