(
this: Parser,
node: Undone<N.ForStatement>,
init?: N.VariableDeclaration | N.Expression | null,
)
| 1336 | // expression. |
| 1337 | |
| 1338 | parseFor( |
| 1339 | this: Parser, |
| 1340 | node: Undone<N.ForStatement>, |
| 1341 | init?: N.VariableDeclaration | N.Expression | null, |
| 1342 | ): N.ForStatement { |
| 1343 | node.init = init; |
| 1344 | this.semicolon(/* allowAsi */ false); |
| 1345 | node.test = this.match(tt.semi) ? null : this.parseExpression(); |
| 1346 | this.semicolon(/* allowAsi */ false); |
| 1347 | node.update = this.match(tt.parenR) ? null : this.parseExpression(); |
| 1348 | this.expect(tt.parenR); |
| 1349 | |
| 1350 | // Parse the loop body. |
| 1351 | node.body = this.parseStatement(); |
| 1352 | |
| 1353 | this.scope.exit(); |
| 1354 | this.state.labels.pop(); |
| 1355 | |
| 1356 | return this.finishNode(node, "ForStatement"); |
| 1357 | } |
| 1358 | |
| 1359 | // Parse a `for`/`in` and `for`/`of` loop, which are almost |
| 1360 | // same from parser's perspective. |
nothing calls this directly
no test coverage detected