From 4dce97e6db25bf11a1486d7bd52f4c4e78b877f6 Mon Sep 17 00:00:00 2001 From: "Moo Yeol, Lee (Prescott)" Date: Tue, 30 Dec 2014 02:25:05 +0900 Subject: [PATCH 1/2] 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. --- browser.js | 1 + 1 file changed, 1 insertion(+) diff --git a/browser.js b/browser.js index ce6369f1..702f2177 100644 --- a/browser.js +++ b/browser.js @@ -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); } From 6af0b4d76431cb642ff443f69321c5bb8ba83b8c Mon Sep 17 00:00:00 2001 From: "Moo Yeol, Lee (Prescott)" Date: Tue, 30 Dec 2014 04:19:49 +0900 Subject: [PATCH 2/2] browser: check for console.log truthiness instead Related to PR #166 --- browser.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/browser.js b/browser.js index 702f2177..eaf1a133 100644 --- a/browser.js +++ b/browser.js @@ -103,9 +103,8 @@ function formatArgs() { function log() { // This hackery is required for IE8, // 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. + return console + && console.log && Function.prototype.apply.call(console.log, console, arguments); }