diff --git a/core/variables.js b/core/variables.js index 2411d3721..173702a7a 100644 --- a/core/variables.js +++ b/core/variables.js @@ -32,6 +32,7 @@ goog.provide('Blockly.Variables'); goog.require('Blockly.Blocks'); goog.require('Blockly.Msg'); +goog.require('Blockly.utils.xml'); goog.require('Blockly.VariableModel'); goog.require('Blockly.Xml'); diff --git a/core/variables_dynamic.js b/core/variables_dynamic.js index ab47337bb..a17c79e2a 100644 --- a/core/variables_dynamic.js +++ b/core/variables_dynamic.js @@ -30,6 +30,7 @@ goog.provide('Blockly.VariablesDynamic'); goog.require('Blockly.Variables'); goog.require('Blockly.Blocks'); goog.require('Blockly.Msg'); +goog.require('Blockly.utils.xml'); goog.require('Blockly.VariableModel'); goog.require('Blockly.Xml'); diff --git a/core/xml.js b/core/xml.js index f5d2abd41..d7461644f 100644 --- a/core/xml.js +++ b/core/xml.js @@ -266,8 +266,7 @@ Blockly.Xml.cloneShadow_ = function(shadow) { if (node) { textNode = node; node = node.nextSibling; - if (textNode.nodeType == Node.TEXT_NODE && - textNode.data.trim() == '') { + if (textNode.nodeType == Node.TEXT_NODE && textNode.data.trim() == '') { // Prune whitespace before a tag. Blockly.utils.dom.removeNode(textNode); } diff --git a/gulpfile.js b/gulpfile.js index 9f9f44f4d..c870e1b77 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -67,6 +67,13 @@ if (typeof DOMParser !== 'function') { return jsdom.window.document; }; } +if (typeof Node !== 'function') { + var Node = { + ELEMENT_NODE: 1, + TEXT_NODE: 3, + DOCUMENT_POSITION_CONTAINED_BY: 16 + }; +} if (typeof module === 'object') { module.exports = Blockly; } if (typeof window === 'object') { window.Blockly = Blockly; }\n`)) .pipe(gulp.dest('.'));