Skip to content

Commit e9c317e

Browse files
author
Gabriel Fouasnon
committed
mimic console.js plugin
1 parent a847aeb commit e9c317e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/raven.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,14 +1079,13 @@ Raven.prototype = {
10791079
},
10801080

10811081
_logDebug: function(level) {
1082-
var args = [].slice.call(arguments, 1);
10831082
if (this._originalConsoleMethods[level] && this.debug) {
1084-
try {
1085-
// For IE<10, cannot invoke 'apply' on console methods
1086-
this._originalConsoleMethods[level].apply(this._originalConsole, args);
1087-
} catch (err) {
1088-
this._originalConsole[level](args.join(' '));
1089-
}
1083+
// taken from plugis/console.js
1084+
// IE9 doesn't allow calling apply on console functions directly
1085+
// See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
1086+
Function.prototype.bind
1087+
.call(this._originalConsoleMethods[level], this._originalConsole)
1088+
.apply(this._originalConsole, [].slice.call(arguments, 1));
10901089
}
10911090
},
10921091

0 commit comments

Comments
 (0)