From 62bb663b38d860f85c81fd886fc96e5b39229825 Mon Sep 17 00:00:00 2001 From: jschanker Date: Sat, 12 Jun 2021 03:22:22 -0400 Subject: [PATCH] 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 --- core/block.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/block.js b/core/block.js index 94ccbeb9c..c7faf8525 100644 --- a/core/block.js +++ b/core/block.js @@ -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);