Migrate core/utils/global.js to goog.module

This commit is contained in:
kozbial
2021-08-17 13:50:50 -07:00
committed by Monica Kozbial
parent 8c95da03b5
commit 7037a15011
2 changed files with 7 additions and 8 deletions

View File

@@ -10,20 +10,17 @@
*/
'use strict';
/**
* @name Blockly.utils.global
* @namespace
*/
goog.provide('Blockly.utils.global');
goog.module('Blockly.utils.global');
goog.module.declareLegacyNamespace();
/**
* Reference to the global object.
*
* More info on this implementation here:
* https://docs.google.com/document/d/1NAeW4Wk7I7FV0Y2tcUFvQdGMc89k2vdgSXInw8_nvCI/edit
* https://docs.google.com/document/d/1NAeW4Wk7I7FV0Y2tcUFvQdGMc89k2vdgSXInw8_nvCI
*/
Blockly.utils.global = function() {
const utilsGlobal = function() {
if (typeof self === 'object') {
return self;
}
@@ -35,3 +32,5 @@ Blockly.utils.global = function() {
}
return this;
}();
exports = utilsGlobal;

View File

@@ -211,7 +211,7 @@ goog.addDependency('../../core/utils/colour.js', ['Blockly.utils.colour'], [], {
goog.addDependency('../../core/utils/coordinate.js', ['Blockly.utils.Coordinate'], [], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/utils/deprecation.js', ['Blockly.utils.deprecation'], [], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/utils/dom.js', ['Blockly.utils.dom'], ['Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/utils/global.js', ['Blockly.utils.global'], []);
goog.addDependency('../../core/utils/global.js', ['Blockly.utils.global'], [], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/utils/idgenerator.js', ['Blockly.utils.IdGenerator'], [], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/utils/keycodes.js', ['Blockly.utils.KeyCodes'], [], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/utils/math.js', ['Blockly.utils.math'], [], {'lang': 'es6', 'module': 'goog'});