diff --git a/package/browser/core.js b/package/browser/core.js index b385cb8ca..3dde18168 100644 --- a/package/browser/core.js +++ b/package/browser/core.js @@ -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); -}; \ No newline at end of file +Blockly.setLocale = function (locale) { + Blockly.Msg = Blockly.Msg || {}; + Object.keys(locale).forEach(function (k) { + Blockly.Msg[k] = locale[k]; + }); +}; diff --git a/package/browser/index.js b/package/browser/index.js index 390d24fa7..32fac243c 100644 --- a/package/browser/index.js +++ b/package/browser/index.js @@ -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; \ No newline at end of file diff --git a/package/node/core.js b/package/node/core.js index 951f8c85a..41d6ff60c 100644 --- a/package/node/core.js +++ b/package/node/core.js @@ -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); -}; \ No newline at end of file +Blockly.setLocale = function (locale) { + Blockly.Msg = Blockly.Msg || {}; + Object.keys(locale).forEach(function (k) { + Blockly.Msg[k] = locale[k]; + }); +}; diff --git a/package/node/index.js b/package/node/index.js index 718a1ee48..003e5bfcd 100644 --- a/package/node/index.js +++ b/package/node/index.js @@ -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;