mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Added tests/setFieldValue error message
* Added tests for getting/setting field (values) when names are not supplied and test for getting a field value, setting it to a new value, and getting it again. * Added more user-friendly error message for setFieldValue telling the developer that he/she is missing the name rather than Field "undefined" not found. * Fixed lint error by removing trailing space
This commit is contained in:
committed by
Christopher Allen
parent
f9c5260fb0
commit
62bb663b38
@@ -1128,7 +1128,7 @@ Blockly.Block.prototype.getFieldValue = function(name) {
|
||||
*/
|
||||
Blockly.Block.prototype.setFieldValue = function(newValue, name) {
|
||||
if (typeof name === "undefined") {
|
||||
throw Error("Call to Blockly.Block.prototype.setFieldValue without " +
|
||||
throw Error("Call to Blockly.Block.prototype.setFieldValue without " +
|
||||
"required second argument of field name.");
|
||||
}
|
||||
var field = this.getField(name);
|
||||
|
||||
Reference in New Issue
Block a user