Throw errors instead of strings. (#1974)

Blocks and generators
This commit is contained in:
Neil Fraser
2018-07-16 16:33:44 -07:00
committed by GitHub
parent 99ebefa1bf
commit c8bfc888c8
23 changed files with 55 additions and 55 deletions

View File

@@ -381,7 +381,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
elseStatementConnection = clauseBlock.statementConnection_;
break;
default:
throw 'Unknown block type.';
throw TypeError('Unknown block type: ' + clauseBlock.type);
}
clauseBlock = clauseBlock.nextConnection &&
clauseBlock.nextConnection.targetBlock();
@@ -419,7 +419,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
inputDo && inputDo.connection.targetConnection;
break;
default:
throw 'Unknown block type.';
throw TypeError('Unknown block type: ' + clauseBlock.type);
}
clauseBlock = clauseBlock.nextConnection &&
clauseBlock.nextConnection.targetBlock();