Skip to content

Commit

Permalink
Fix Meteor._debug on IE8,9
Browse files Browse the repository at this point in the history
  • Loading branch information
n1mmy committed Jul 12, 2012
1 parent 26136a2 commit 564b292
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/logging/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,20 @@
// IE10 PP4 requires at least one argument
console.log('');
} else {
console.log.apply(console, arguments);
// IE doesn't have console.log.apply, it's not a real Object.
// http://stackoverflow.com/questions/5538972/console-log-apply-not-working-in-ie9
// http://patik.com/blog/complete-cross-browser-console-log/
if (typeof console.log.apply === "function") {
// Most browsers
console.log.apply(console, arguments);
} else if (typeof Function.prototype.bind === "function") {
// IE9
var log = Function.prototype.bind.call(console.log, console);
log.apply(console, arguments);
} else {
// IE8
Function.prototype.call.call(console.log, console, Array.prototype.slice.call(arguments));
}
}
}
};
Expand All @@ -31,5 +44,5 @@
// stop tests from spamming the console.
Meteor._suppress_log = function (count) {
suppress += count;
}
};
})();

0 comments on commit 564b292

Please sign in to comment.