()
| 74 | } |
| 75 | |
| 76 | async runAsync() { |
| 77 | if (this.hasRun) { |
| 78 | throw new ChibiError('Run method can only be executed once'); |
| 79 | } |
| 80 | this.hasRun = true; |
| 81 | const state = await this._subroutineAsync(this.script); |
| 82 | |
| 83 | if (state && state instanceof ChibiReturn) { |
| 84 | return state.getValue(); |
| 85 | } |
| 86 | |
| 87 | return state; |
| 88 | } |
| 89 | |
| 90 | async _subroutineAsync(script: ChibiJson<any>, startState: any = null) { |
| 91 | this.ctx.setAsyncContext(true); |
nothing calls this directly
no test coverage detected