Adding warning on duplicate JSON block definition.

This commit is contained in:
Andrew n marshall
2017-02-24 15:41:56 -08:00
parent 89c2bf66ca
commit a9aabd637f

View File

@@ -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)
};