diff --git a/core/msg.js b/core/msg.js index 8cf7a2c5b..506473094 100644 --- a/core/msg.js +++ b/core/msg.js @@ -14,18 +14,19 @@ * Name space for the Msg singleton. * Msg gets populated in the message files. */ -goog.provide('Blockly.Msg'); +goog.module('Blockly.Msg'); +goog.module.declareLegacyNamespace(); -goog.require('Blockly.utils.global'); +const global = goog.require('Blockly.utils.global'); /** * Exported so that if Blockly is compiled with ADVANCED_COMPILATION, * the Blockly.Msg object exists for message files included in script tags. */ -if (!Blockly.utils.global['Blockly']) { - Blockly.utils.global['Blockly'] = {}; +if (!global['Blockly']) { + global['Blockly'] = {}; } -if (!Blockly.utils.global['Blockly']['Msg']) { - Blockly.utils.global['Blockly']['Msg'] = Blockly.Msg; +if (!global['Blockly']['Msg']) { + global['Blockly']['Msg'] = exports; } diff --git a/tests/deps.js b/tests/deps.js index ec33762a5..afb8f4031 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -127,7 +127,7 @@ goog.addDependency('../../core/marker_manager.js', ['Blockly.MarkerManager'], [] goog.addDependency('../../core/menu.js', ['Blockly.Menu'], ['Blockly.browserEvents', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.style'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/menuitem.js', ['Blockly.MenuItem'], ['Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/metrics_manager.js', ['Blockly.MetricsManager'], ['Blockly.registry', 'Blockly.utils.Size', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/msg.js', ['Blockly.Msg'], ['Blockly.utils.global']); +goog.addDependency('../../core/msg.js', ['Blockly.Msg'], ['Blockly.utils.global'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Icon', 'Blockly.Options', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.internalConstants', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/names.js', ['Blockly.Names'], ['Blockly.Msg', 'Blockly.Variables', 'Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/options.js', ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.registry', 'Blockly.utils.deprecation', 'Blockly.utils.idGenerator', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'});