From b8a1873f0104aa4568526f40f2aad396fad61ab4 Mon Sep 17 00:00:00 2001 From: Andrew n marshall Date: Fri, 31 Aug 2018 12:42:38 -0700 Subject: [PATCH] Converting bad block warning into an error. --- core/block.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/block.js b/core/block.js index d73336697..8b451bd6c 100644 --- a/core/block.js +++ b/core/block.js @@ -53,14 +53,13 @@ goog.require('goog.math.Coordinate'); * @param {string=} opt_id Optional ID. Use this ID if provided, otherwise * create a new ID. * @constructor + * @throw When block is not valid or block name is not allowed. */ Blockly.Block = function(workspace, prototypeName, opt_id) { if (typeof Blockly.Generator.prototype[prototypeName] !== 'undefined') { - console.warn('FUTURE ERROR: Block prototypeName "' + prototypeName + - '" conflicts with Blockly.Generator members. Registering Generators ' + - 'for this block type will incur errors.' + - '\nThis name will be DISALLOWED (throwing an error) in future ' + - 'versions of Blockly.'); + // Occluding Generator class members is not allowed. + throw Error('Block prototypeName "' + prototypeName + + '" conflicts with Blockly.Generator members.'); } /** @type {string} */