Support console.log in IE9

IE9 does console incorrectly, this fixes according to http://stackoverflow.com/questions/5538972/console-log-apply-not-working-in-ie9
This commit is contained in:
Greg MacLellan
2012-11-13 13:03:16 -05:00
parent abcd97d512
commit ad944b93f3

View File

@@ -65,7 +65,15 @@ function clippyCopiedCallback(a) {
function log() { function log() {
if (window.console) console.log.apply(console,arguments); if (window.console) console.log.apply(console,arguments);
} }
// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
if (Function.prototype.bind && console && typeof console.log == "object") {
[
"log","info","warn","error","assert","dir","clear","profile","profileEnd"
].forEach(function (method) {
console[method] = this.bind(console[method], console);
}, Function.prototype.call);
}
var Docs = { var Docs = {
shebang: function() { shebang: function() {