(startState: any = null)
| 22 | } |
| 23 | |
| 24 | run(startState: any = null) { |
| 25 | if (this.hasRun) { |
| 26 | throw new ChibiError('Run method can only be executed once'); |
| 27 | } |
| 28 | this.hasRun = true; |
| 29 | const state = this._subroutine(this.script, startState); |
| 30 | |
| 31 | if (state && state instanceof ChibiReturn) { |
| 32 | return state.getValue(); |
| 33 | } |
| 34 | |
| 35 | return state; |
| 36 | } |
| 37 | |
| 38 | _subroutine(script: ChibiJson<any>, startState: any = null) { |
| 39 | this.ctx.setAsyncContext(false); |
nothing calls this directly
no test coverage detected