Fix UMD build in IE11 (#3158)

* Fix the UMD build in IE11. No Object.assign
This commit is contained in:
Sam El-Husseini
2019-10-04 10:03:58 -07:00
committed by GitHub
parent bc68167763
commit 893461384e
4 changed files with 20 additions and 8 deletions

View File

@@ -24,6 +24,9 @@
'use strict';
// Add a helper method to set the Blockly locale.
Blockly.setLocale = function(locale) {
Blockly.Msg = Object.assign(Blockly.Msg || {}, locale);
};
Blockly.setLocale = function (locale) {
Blockly.Msg = Blockly.Msg || {};
Object.keys(locale).forEach(function (k) {
Blockly.Msg[k] = locale[k];
});
};

View File

@@ -27,6 +27,9 @@
// Include the EN Locale by default.
Blockly.setLocale(En);
Blockly.Blocks = Object.assign(Blockly.Blocks, BlocklyBlocks);
Blockly.Blocks = Blockly.Blocks || {};
Object.keys(BlocklyBlocks).forEach(function (k) {
Blockly.Blocks[k] = BlocklyBlocks[k];
});
Blockly.JavaScript = BlocklyJS;

View File

@@ -24,6 +24,9 @@
'use strict';
// Add a helper method to set the Blockly locale.
Blockly.setLocale = function(locale) {
Blockly.Msg = Object.assign(Blockly.Msg || {}, locale);
};
Blockly.setLocale = function (locale) {
Blockly.Msg = Blockly.Msg || {};
Object.keys(locale).forEach(function (k) {
Blockly.Msg[k] = locale[k];
});
};

View File

@@ -26,7 +26,10 @@
// Include the EN Locale by default.
Blockly.setLocale(En);
Blockly.Blocks = Object.assign(Blockly.Blocks, BlocklyBlocks);
Blockly.Blocks = Blockly.Blocks || {};
Object.keys(BlocklyBlocks).forEach(function (k) {
Blockly.Blocks[k] = BlocklyBlocks[k];
});
Blockly.JavaScript = BlocklyJS;