mirror of
https://github.com/google/blockly.git
synced 2026-01-14 04:17:10 +01:00
Add missing utils.global (#3286)
Compile is breaking due to the JS environment sweep.
This commit is contained in:
3
build.py
3
build.py
@@ -266,6 +266,7 @@ goog.provide('Blockly.Mutator');
|
||||
# with the compiler.
|
||||
params.append(("js_code", """
|
||||
goog.provide('Blockly.Generator');
|
||||
goog.provide('Blockly.utils.global');
|
||||
goog.provide('Blockly.utils.string');
|
||||
"""))
|
||||
filenames = glob.glob(
|
||||
@@ -280,7 +281,7 @@ goog.provide('Blockly.utils.string');
|
||||
|
||||
# Remove Blockly.Generator and Blockly.utils.string to be compatible
|
||||
# with Blockly.
|
||||
remove = r"var Blockly=\{[^;]*\};\s*Blockly.utils.string={};\n?"
|
||||
remove = r"var Blockly=\{[^;]*\};\s*Blockly.utils.global={};\s*Blockly.utils.string={};\n?"
|
||||
self.do_compile(params, target_filename, filenames, remove)
|
||||
|
||||
def do_compile(self, params, target_filename, filenames, remove):
|
||||
|
||||
@@ -173,6 +173,7 @@ goog.provide('Blockly.Mutator');`;
|
||||
function buildGenerator(language, namespace) {
|
||||
var provides = `
|
||||
goog.provide('Blockly.Generator');
|
||||
goog.provide('Blockly.utils.global');
|
||||
goog.provide('Blockly.utils.string');`;
|
||||
return gulp.src([`generators/${language}.js`, `generators/${language}/*.js`], {base: './'})
|
||||
.pipe(stripApacheLicense())
|
||||
@@ -185,7 +186,7 @@ goog.provide('Blockly.utils.string');`;
|
||||
}, argv.verbose))
|
||||
.pipe(gulp.replace('\'use strict\';', '\'use strict\';\n\n\n'))
|
||||
// Remove Blockly.Generator and Blockly.utils.string to be compatible with Blockly.
|
||||
.pipe(gulp.replace(/var Blockly=\{[^;]*\};\s*Blockly.utils.string={};\n?/, ''))
|
||||
.pipe(gulp.replace(/var Blockly=\{[^;]*\};\s*Blockly.utils.global={};\s*Blockly.utils.string={};\n?/, ''))
|
||||
.pipe(prependHeader())
|
||||
.pipe(gulp.dest('./'));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user