From 4e14ff8a6f80647ee8286be69830a86aaee41c70 Mon Sep 17 00:00:00 2001 From: Thomas Stephens Date: Fri, 19 Jun 2015 11:27:18 -0500 Subject: [PATCH] Code review comments --- lib/debug/asserts.js | 1 + lib/debug/log.js | 1 + support.js | 3 +++ 3 files changed, 5 insertions(+) diff --git a/lib/debug/asserts.js b/lib/debug/asserts.js index 143a7923c..1cf7866eb 100644 --- a/lib/debug/asserts.js +++ b/lib/debug/asserts.js @@ -49,6 +49,7 @@ shaka.asserts.patchAssert_ = function() { if (!assert) { console.assert = function() {}; } else if (!assert.bind) { + // IE 9 does not provide a .bind for the built-in console functions. console.assert = function() { assert.apply(console, arguments); } diff --git a/lib/debug/log.js b/lib/debug/log.js index 97571785c..fdb117cee 100644 --- a/lib/debug/log.js +++ b/lib/debug/log.js @@ -76,6 +76,7 @@ shaka.log.patchConsole_ = function(logName) { if (!logFunction) { console[logName] = nop; } else if (!logFunction.bind) { + // IE 9 does not provide a .bind for the built-in logging functions. console[logName] = function() { logFunction.apply(console, arguments); } diff --git a/support.js b/support.js index 745d934ba..0b3550b2b 100644 --- a/support.js +++ b/support.js @@ -304,6 +304,9 @@ if (async.length) { } function onLoaded(fn) { + // IE 9 fires DOMContentLoaded, and enters the "interactive" + // readyState, before document.body has been initialized, so wait + // for window.load if (document.readyState == "loading" || document.readyState == "interactive") { window.addEventListener('load', fn);