From a9aabd637f4af56e0650f948afd02d31864810b8 Mon Sep 17 00:00:00 2001 From: Andrew n marshall Date: Fri, 24 Feb 2017 15:41:56 -0800 Subject: [PATCH] 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) };