(program: Ast.Node[], scope: Scope, callStack: readonly CallInfo[])
| 1568 | |
| 1569 | @autobind |
| 1570 | private _runSync(program: Ast.Node[], scope: Scope, callStack: readonly CallInfo[]): Value | Control { |
| 1571 | this.log('block:enter', { scope: scope.name }); |
| 1572 | |
| 1573 | let v: Value | Control = NULL; |
| 1574 | |
| 1575 | for (let i = 0; i < program.length; i++) { |
| 1576 | const node = program[i]!; |
| 1577 | |
| 1578 | v = this._evalSync(node, scope, callStack); |
| 1579 | if (v.type === 'return') { |
| 1580 | this.log('block:return', { scope: scope.name, val: v.value }); |
| 1581 | return v; |
| 1582 | } else if (v.type === 'break') { |
| 1583 | this.log('block:break', { scope: scope.name }); |
| 1584 | return v; |
| 1585 | } else if (v.type === 'continue') { |
| 1586 | this.log('block:continue', { scope: scope.name }); |
| 1587 | return v; |
| 1588 | } |
| 1589 | } |
| 1590 | |
| 1591 | this.log('block:leave', { scope: scope.name, val: v }); |
| 1592 | return v; |
| 1593 | } |
| 1594 | |
| 1595 | @autobind |
| 1596 | public registerAbortHandler(handler: () => void): void { |
no test coverage detected