MCPcopy
hub / github.com/RaspberryPiFoundation/blockly / setFieldValue

Method setFieldValue

packages/blockly/core/block.ts:1236–1242  ·  view source on GitHub ↗

* Sets the value of the given field for this block. * * @param newValue The value to set. * @param name The name of the field to set the value of.

(newValue: AnyDuringMigration, name: string)

Source from the content-addressed store, hash-verified

1234 * @param name The name of the field to set the value of.
1235 */
1236 setFieldValue(newValue: AnyDuringMigration, name: string) {
1237 const field = this.getField(name);
1238 if (!field) {
1239 throw Error('Field "' + name + '" not found.');
1240 }
1241 field.setValue(newValue);
1242 }
1243
1244 /**
1245 * Set whether this block can chain onto the bottom of another block.

Callers 9

procedures.tsFile · 0.80
block_test.jsFile · 0.80
mutator_test.jsFile · 0.80
connection_test.jsFile · 0.80
procedures_test.jsFile · 0.80
createMutatorFunction · 0.80
blocks.jsFile · 0.80

Calls 1

getFieldMethod · 0.95

Tested by

no test coverage detected