Skip to content

Commit 6af0b4d

Browse files
committed
browser: check for console.log truthiness instead
Related to PR debug-js#166
1 parent 4dce97e commit 6af0b4d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

browser.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ function formatArgs() {
103103
function log() {
104104
// This hackery is required for IE8,
105105
// where the `console.log` function doesn't have 'apply'
106-
return 'object' == typeof console
107-
&& 'function' == typeof console.log
108-
|| 'object' == typeof console.log // IE 8-9 reports console methods as objects when using the typeof operator.
106+
return console
107+
&& console.log
109108
&& Function.prototype.apply.call(console.log, console, arguments);
110109
}
111110

0 commit comments

Comments
 (0)