From a9aabd637f4af56e0650f948afd02d31864810b8 Mon Sep 17 00:00:00 2001 From: Andrew n marshall Date: Fri, 24 Feb 2017 15:41:56 -0800 Subject: [PATCH 1/2] Adding warning on duplicate JSON block definition. --- core/blockly.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/blockly.js b/core/blockly.js index 558c72014..aeddf97b3 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -410,6 +410,10 @@ Blockly.defineBlocksWithJsonArray = function(jsonArray) { console.warn('Block definition #' + i + ' in JSON array is missing a type attribute. Skipping.'); } else { + if (Blockly.Blocks[typename]) { + console.warn('Block definition #' + i + + ' in JSON array overwrites prior definition of "' + typename + '"'); + } Blockly.Blocks[typename] = { init: Blockly.jsonInitFactory_(elem) }; From 1bc74819aa0d0be291ef27f62315b01fd777bdc2 Mon Sep 17 00:00:00 2001 From: Andrew n marshall Date: Fri, 24 Feb 2017 15:47:35 -0800 Subject: [PATCH 2/2] period --- core/blockly.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/blockly.js b/core/blockly.js index aeddf97b3..7cd0e449d 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -412,7 +412,7 @@ Blockly.defineBlocksWithJsonArray = function(jsonArray) { } else { if (Blockly.Blocks[typename]) { console.warn('Block definition #' + i + - ' in JSON array overwrites prior definition of "' + typename + '"'); + ' in JSON array overwrites prior definition of "' + typename + '".'); } Blockly.Blocks[typename] = { init: Blockly.jsonInitFactory_(elem)