mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Reexport global.globalThis as Blockly.utils.global (#5534)
Fixes #5503 This makes the value of Blockly.utils.global the same as it was before PR #5451.
This commit is contained in:
committed by
GitHub
parent
8ab8536739
commit
f931b2eb36
@@ -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;
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user