Commit b935dd86 authored by Neil Fraser's avatar Neil Fraser

Fix DOMParser in node.js

parent 9c1e8588
......@@ -1586,6 +1586,11 @@ delete this.BLOCKLY_DIR;
delete this.BLOCKLY_BOOT;
};
if (typeof DOMParser == 'undefined' && typeof require == 'function') {
// Node.js needs DOMParser loaded separately.
var DOMParser = require('xmldom').DOMParser;
}
// Delete any existing Closure (e.g. Soy's nogoog_shim).
document.write('<script>var goog = undefined;</script>');
// Load fresh Closure Library.
......
......@@ -132,6 +132,11 @@ delete this.BLOCKLY_DIR;
delete this.BLOCKLY_BOOT;
};
if (typeof DOMParser == 'undefined' && typeof require == 'function') {
// Node.js needs DOMParser loaded separately.
var DOMParser = require('xmldom').DOMParser;
}
// Delete any existing Closure (e.g. Soy's nogoog_shim).
document.write('<script>var goog = undefined;</script>');
// Load fresh Closure Library.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment