Skip to content

Commit 36db1b7

Browse files
author
Gabriel Fouasnon
committed
use Function.prototype.apply
1 parent 8f14ba9 commit 36db1b7

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+
// In IE<10 console methods do not have their own 'apply' method
1084+
Function.prototype.apply.call(
1085+
this._originalConsoleMethods[level],
1086+
this._originalConsole,
1087+
[].slice.call(arguments, 1)
1088+
);
10901089
}
10911090
},
10921091

0 commit comments

Comments
 (0)