* Walk for of statement. * @param {ForOfStatement} statement for statement
(statement)
| 2758 | * @param {ForOfStatement} statement for statement |
| 2759 | */ |
| 2760 | walkForOfStatement(statement) { |
| 2761 | this.inBlockScope(() => { |
| 2762 | if (statement.left.type === "VariableDeclaration") { |
| 2763 | this.blockPreWalkVariableDeclaration(statement.left); |
| 2764 | this.walkVariableDeclaration(statement.left); |
| 2765 | } else { |
| 2766 | this.walkPattern(statement.left); |
| 2767 | } |
| 2768 | |
| 2769 | this.walkExpression(statement.right); |
| 2770 | |
| 2771 | const body = statement.body; |
| 2772 | |
| 2773 | if (body.type === "BlockStatement") { |
| 2774 | // no need to add additional scope |
| 2775 | const prev = this.prevStatement; |
| 2776 | this.blockPreWalkStatements(body.body); |
| 2777 | this.prevStatement = prev; |
| 2778 | this.walkStatements(body.body); |
| 2779 | } else { |
| 2780 | this.walkNestedStatement(body); |
| 2781 | } |
| 2782 | }); |
| 2783 | } |
| 2784 | |
| 2785 | /** |
| 2786 | * Pre walk function declaration. |
no test coverage detected