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