Skip to content

Commit b0d4277

Browse files
authored
Merge pull request #290 from qinyang912/master
fix: Uncaught TypeError: Illegal invocation in chrome 51
2 parents ca4816f + 7c729d7 commit b0d4277

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/logger/logger.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ var SUPPORTED_METHODS = [
55
];
66

77
function Logger() {
8-
this.setMethods(console);
8+
var defaultMethods = {};
9+
SUPPORTED_METHODS.forEach(function (method) {
10+
// Deal with Chrome issue: https://bugs.chromium.org/p/chromium/issues/detail?id=179628
11+
defaultMethods[method] = console[method].bind(console);
12+
});
13+
this.setMethods(defaultMethods);
914
}
1015
module.exports = Logger;
1116

0 commit comments

Comments
 (0)