diff --git a/core/blockly.js b/core/blockly.js index b07180a75..9702271ba 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -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); diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 66175d36e..b2abe9f98 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -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) {