* 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)
| 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. |
no test coverage detected