mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
Merge pull request #954 from AnmAtAnm/warn-on-overwrite
Adding warning on duplicate JSON block definition.
This commit is contained in:
@@ -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)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user