* Walk try statement. * @param {TryStatement} statement try statement
(statement)
| 2581 | * @param {TryStatement} statement try statement |
| 2582 | */ |
| 2583 | walkTryStatement(statement) { |
| 2584 | if (this.scope.inTry) { |
| 2585 | this.walkStatement(statement.block); |
| 2586 | } else { |
| 2587 | this.scope.inTry = true; |
| 2588 | this.walkStatement(statement.block); |
| 2589 | this.scope.inTry = false; |
| 2590 | } |
| 2591 | |
| 2592 | const tryTerminated = this.scope.terminated; |
| 2593 | this.scope.terminated = undefined; |
| 2594 | |
| 2595 | if (statement.handler) this.walkCatchClause(statement.handler); |
| 2596 | |
| 2597 | const handlerTerminated = this.scope.terminated; |
| 2598 | this.scope.terminated = undefined; |
| 2599 | |
| 2600 | if (statement.finalizer) { |
| 2601 | this.walkStatement(statement.finalizer); |
| 2602 | } |
| 2603 | |
| 2604 | const finalizerTerminated = this.scope.terminated; |
| 2605 | this.scope.terminated = undefined; |
| 2606 | |
| 2607 | if (finalizerTerminated) { |
| 2608 | this.scope.terminated = finalizerTerminated; |
| 2609 | } else if ( |
| 2610 | tryTerminated && |
| 2611 | (statement.handler ? handlerTerminated : true) |
| 2612 | ) { |
| 2613 | this.scope.terminated = handlerTerminated || tryTerminated; |
| 2614 | } |
| 2615 | } |
| 2616 | |
| 2617 | /** |
| 2618 | * Pre walk while statement. |
no test coverage detected