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

Method removeInput

packages/blockly/core/block.ts:2287–2300  ·  view source on GitHub ↗

* Remove an input from this block. * * @param name The name of the input. * @param opt_quiet True to prevent an error if input is not present. * @returns True if operation succeeds, false if input is not present and * opt_quiet is true. * @throws {Error} if the input is not pre

(name: string, opt_quiet?: boolean)

Source from the content-addressed store, hash-verified

2285 * @throws {Error} if the input is not present and opt_quiet is not true.
2286 */
2287 removeInput(name: string, opt_quiet?: boolean): boolean {
2288 for (let i = 0, input; (input = this.inputList[i]); i++) {
2289 if (input.name === name) {
2290 if (input instanceof StatementInput) this.statementInputCount--;
2291 input.dispose();
2292 this.inputList.splice(i, 1);
2293 return true;
2294 }
2295 }
2296 if (opt_quiet) {
2297 return false;
2298 }
2299 throw Error('Input not found: ' + name);
2300 }
2301
2302 /**
2303 * Fetches the named input object.

Callers 8

text.tsFile · 0.45
lists.tsFile · 0.45
math.tsFile · 0.45
procedures.tsFile · 0.45
logic.tsFile · 0.45
block_test.jsFile · 0.45
defineMutatorBlocksFunction · 0.45
blocks.jsFile · 0.45

Calls 1

disposeMethod · 0.65

Tested by

no test coverage detected