Skip to content

Commit 4dce97e

Browse files
committed
browser: Fixed that no logs output on IE8/9
IE 8/9 reports console methods as objects when using the typeof operator. https://web.archive.org/web/20111123190115/http://whattheheadsaid.com/2011/04/internet-explorer-9s-problematic-console-object Closes debug-js#148.
1 parent 953162b commit 4dce97e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

browser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function log() {
105105
// where the `console.log` function doesn't have 'apply'
106106
return 'object' == typeof console
107107
&& 'function' == typeof console.log
108+
|| 'object' == typeof console.log // IE 8-9 reports console methods as objects when using the typeof operator.
108109
&& Function.prototype.apply.call(console.log, console, arguments);
109110
}
110111

0 commit comments

Comments
 (0)