chore: correctly updates the compiled flag (#5767)

This commit is contained in:
alschmiedt
2021-12-02 08:29:53 -08:00
committed by GitHub
parent ee18553035
commit 35279eb8b7
2 changed files with 2 additions and 5 deletions

View File

@@ -183,11 +183,6 @@ goog.require('Blockly.Events.VarCreate');
*/
exports.VERSION = 'uncompiled';
/**
* @define {boolean} Overridden to true by the compiler.
*/
const COMPILED = false;
// Add a getter and setter pair for Blockly.alert, Blockly.confirm,
// Blockly.mainWorkspace, Blockly.prompt and Blockly.selected for backwards
// compatibility.
@@ -733,6 +728,7 @@ exports.zelos = zelos;
// accessors are nonconfigurable (which is good, as otherwise one
// accessors on one copy would call get/set functions on the other
// copy!)
/* eslint-disable-next-line no-undef */
if (!COMPILED && typeof globalThis['Blockly'] === 'object' &&
globalThis['Blockly'] !== exports) {
const descriptors = Object.getOwnPropertyDescriptors(exports);

View File

@@ -457,6 +457,7 @@ function compile(options) {
language_out: 'ECMASCRIPT5_STRICT',
rewrite_polyfills: true,
hide_warnings_for: 'node_modules',
define: ['COMPILED=true'],
externs: ['./externs/svg-externs.js'],
};
if (argv.debug || argv.strict) {