mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Create stub for Node contstants.
Ironic that Node doesn’t have Node. Not tested. Fix two missing dependencies.
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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('.'));
|
||||
|
||||
Reference in New Issue
Block a user