diff --git a/core/utils.js b/core/utils.js index a1a4d1c89..594b3ddff 100644 --- a/core/utils.js +++ b/core/utils.js @@ -52,7 +52,7 @@ exports.colour = colourUtils; exports.Coordinate = Coordinate; exports.deprecation = deprecation; exports.dom = dom; -exports.global = global; +exports.global = global.globalThis; exports.idGenerator = idGenerator; exports.KeyCodes = KeyCodes; exports.math = math; diff --git a/scripts/migration/renamings.js b/scripts/migration/renamings.js index 9423c54eb..d5e75d071 100644 --- a/scripts/migration/renamings.js +++ b/scripts/migration/renamings.js @@ -130,6 +130,7 @@ const renamings = { }, 'Blockly.utils.global': { export: 'globalThis', // Previous default export now named. + path: 'Blockly.utils.global', // But still exported under original name. }, 'Blockly.utils.IdGenerator': { module: 'Blockly.utils.idGenerator', diff --git a/scripts/package/node/core.js b/scripts/package/node/core.js index 35e063b91..9692855d3 100644 --- a/scripts/package/node/core.js +++ b/scripts/package/node/core.js @@ -22,7 +22,7 @@ Blockly.setLocale = function (locale) { // Override textToDomDocument and provide Node.js alternatives to DOMParser and // XMLSerializer. -const globalThis = Blockly.utils.global.globalThis; +const globalThis = Blockly.utils.global; if (typeof globalThis.document !== 'object') { const jsdom = require('jsdom/lib/jsdom/living'); globalThis.DOMParser = jsdom.DOMParser;