* Walks a conditional branch with its guard frame (if any) pushed onto the * parser-state guard stack for the duration of the branch body. * @param {EXPECTED_OBJECT | undefined | null} frame guard frame, or falsy when the branch is unguarded * @param {() => void} walk branch walk * @returns
(frame, walk)
| 2426 | * @returns {void} |
| 2427 | */ |
| 2428 | walkGuardedBranch(frame, walk) { |
| 2429 | if (!frame) { |
| 2430 | walk(); |
| 2431 | return; |
| 2432 | } |
| 2433 | const stack = this.state.guardStack || (this.state.guardStack = []); |
| 2434 | stack.push(frame); |
| 2435 | try { |
| 2436 | walk(); |
| 2437 | } finally { |
| 2438 | stack.pop(); |
| 2439 | } |
| 2440 | } |
| 2441 | |
| 2442 | /** |
| 2443 | * Processes the provided statement. |
no test coverage detected