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

@@ -160,7 +160,7 @@ Blockly.Dart['math_single'] = function(block) {
code = 'Math.atan(' + arg + ') / Math.PI * 180';
break;
default:
throw 'Unknown math operator: ' + operator;
throw Error('Unknown math operator: ' + operator);
}
return [code, Blockly.Dart.ORDER_MULTIPLICATIVE];
};
@@ -426,7 +426,7 @@ Blockly.Dart['math_on_list'] = function(block) {
code = functionName + '(' + list + ')';
break;
default:
throw 'Unknown operator: ' + func;
throw Error('Unknown operator: ' + func);
}
return [code, Blockly.Dart.ORDER_UNARY_POSTFIX];
};