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 #148.
This commit is contained in:
Moo Yeol, Lee (Prescott) 2014-12-30 02:25:05 +09:00
parent 953162b4fa
commit 4dce97e6db

View File

@ -105,6 +105,7 @@ function log() {
// where the `console.log` function doesn't have 'apply'
return 'object' == typeof console
&& 'function' == typeof console.log
|| 'object' == typeof console.log // IE 8-9 reports console methods as objects when using the typeof operator.
&& Function.prototype.apply.call(console.log, console, arguments);
}