diff --git a/blocks/logic.js b/blocks/logic.js index 5899e04a5..a37387d8f 100644 --- a/blocks/logic.js +++ b/blocks/logic.js @@ -564,12 +564,12 @@ Blockly.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN = { * @readonly */ Blockly.Constants.Logic.LOGIC_COMPARE_EXTENSION = function() { - // Fix operator labels in RTL + // Fix operator labels in RTL. if (this.RTL) { Blockly.Constants.Logic.fixLogicCompareRtlOpLabels.apply(this); } - // Add onchange handler to ensure types are compatable. + // Add onchange handler to ensure types are compatible. this.mixin(Blockly.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN); }; diff --git a/core/extensions.js b/core/extensions.js index 774233c8d..5f9a9da29 100644 --- a/core/extensions.js +++ b/core/extensions.js @@ -328,7 +328,7 @@ Blockly.Extensions.buildTooltipForDropdown = function(dropdownName, // Wait for load, in case Blockly.Msg is not yet populated. // runAfterPageLoad() does not run in a Node.js environment due to lack of // document object, in which case skip the validation. - if (document) { // Relies on document.readyState + if (typeof document == 'object') { // Relies on document.readyState Blockly.utils.runAfterPageLoad(function() { for (var key in lookupTable) { // Will print warnings if reference is missing. @@ -409,7 +409,7 @@ Blockly.Extensions.buildTooltipWithFieldValue = function(msgTemplate, // Wait for load, in case Blockly.Msg is not yet populated. // runAfterPageLoad() does not run in a Node.js environment due to lack of // document object, in which case skip the validation. - if (document) { // Relies on document.readyState + if (typeof document == 'object') { // Relies on document.readyState Blockly.utils.runAfterPageLoad(function() { // Will print warnings if reference is missing. Blockly.utils.checkMessageReferences(msgTemplate); diff --git a/core/utils.js b/core/utils.js index 8f2179e5c..b715bf470 100644 --- a/core/utils.js +++ b/core/utils.js @@ -896,7 +896,7 @@ Blockly.utils.insertAfter_ = function(newNode, refNode) { * @throws Error Will throw if no global document can be found (e.g., Node.js). */ Blockly.utils.runAfterPageLoad = function(fn) { - if (!document) { + if (typeof document != 'object') { throw new Error('Blockly.utils.runAfterPageLoad() requires browser document.'); } if (document.readyState === 'complete') {