From 91b10cae2fccc341640b5bcc7bdb09dbb9979483 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Wed, 22 Jun 2016 13:00:29 -0700 Subject: [PATCH] Create console stub for IE 9. --- core/blockly.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/blockly.js b/core/blockly.js index c51191b08..cda45992e 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -557,6 +557,14 @@ Blockly.getMainWorkspace = function() { return Blockly.mainWorkspace; }; +// IE9 does not have a console. Create a stub to stop errors. +if (!goog.global['console']) { + goog.global['console'] = { + 'log': function() {}, + 'warn': function() {} + }; +} + // Export symbols that would otherwise be renamed by Closure compiler. if (!goog.global['Blockly']) { goog.global['Blockly'] = {};