Skip to content

Commit

Permalink
fix(test): Fix advanced compilation test
Browse files Browse the repository at this point in the history
- Fix loading of blocks in `tests/compile/main.js` caused by
  recent `goog.module`-ification work.
- Fix problem caused by ADVANCED_OPTIMISATIONS renaming the Msg
  property on the fake Blockly object created by the
  translation-loading hack in `blockly.js`.
  • Loading branch information
cpcallen committed Dec 3, 2021
1 parent b52c017 commit 8370647
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/blockly.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ exports.zelos = zelos;
// Blockly.Msg module - so make sure it is, but only if there is not
// yet a Blockly global variable.
if (!('Blockly' in globalThis)) {
globalThis['Blockly'] = {Msg};
globalThis['Blockly'] = {'Msg': Msg};
}

// Temporary hack to copy accessor properties from exports to the
Expand Down
12 changes: 2 additions & 10 deletions tests/compile/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ goog.require('Blockly');
goog.require('Blockly.geras.Renderer');
goog.require('Blockly.VerticalFlyout');
// Blocks
goog.require('Blockly.Constants.Logic');
goog.require('Blockly.Constants.Loops');
goog.require('Blockly.Constants.Math');
goog.require('Blockly.Constants.TestBlocks');
goog.require('Blockly.Constants.Text');
goog.require('Blockly.Constants.Lists');
goog.require('Blockly.Constants.Colour');
goog.require('Blockly.Constants.Variables');
goog.require('Blockly.Constants.VariablesDynamic');
goog.require('Blockly.blocks.procedures');
goog.require('Blockly.blocks.all');
goog.require('Blockly.blocks.testBlocks');

Main.init = function() {
Blockly.inject('blocklyDiv', {
Expand Down
2 changes: 1 addition & 1 deletion tests/compile/test_blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
'use strict';

goog.provide('Blockly.Constants.TestBlocks');
goog.provide('Blockly.blocks.testBlocks');

goog.require('Blockly');

Expand Down

0 comments on commit 8370647

Please sign in to comment.