Create stub for Node contstants.

Ironic that Node doesn’t have Node.  Not tested.
Fix two missing dependencies.
This commit is contained in:
Neil Fraser
2019-07-12 15:42:38 -07:00
committed by Neil Fraser
parent 31a9c02362
commit 0e82677f27
4 changed files with 10 additions and 2 deletions

View File

@@ -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');

View File

@@ -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');

View File

@@ -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);
}

View File

@@ -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('.'));