(
this: Parser,
node: Undone<N.DoExpression>,
isAsync: boolean,
)
| 1568 | // https://github.com/tc39/proposal-do-expressions |
| 1569 | // https://github.com/tc39/proposal-async-do-expressions |
| 1570 | parseDo( |
| 1571 | this: Parser, |
| 1572 | node: Undone<N.DoExpression>, |
| 1573 | isAsync: boolean, |
| 1574 | ): N.DoExpression { |
| 1575 | this.expectPlugin("doExpressions"); |
| 1576 | if (isAsync) { |
| 1577 | this.expectPlugin("asyncDoExpressions"); |
| 1578 | } |
| 1579 | node.async = isAsync; |
| 1580 | this.next(); // eat `do` |
| 1581 | const oldLabels = this.state.labels; |
| 1582 | this.state.labels = []; |
| 1583 | if (isAsync) { |
| 1584 | // AsyncDoExpression : |
| 1585 | // async [no LineTerminator here] do Block[~Yield, +Await, ~Return] |
| 1586 | this.expressionScope.enter(sharedExpressionScope); |
| 1587 | this.prodParam.enter(ParamKind.PARAM_AWAIT); |
| 1588 | node.body = this.parseBlock(); |
| 1589 | this.prodParam.exit(); |
| 1590 | this.expressionScope.exit(); |
| 1591 | } else { |
| 1592 | node.body = this.parseBlock(); |
| 1593 | } |
| 1594 | |
| 1595 | this.state.labels = oldLabels; |
| 1596 | return this.finishNode(node, "DoExpression"); |
| 1597 | } |
| 1598 | |
| 1599 | // Parse the `super` keyword |
| 1600 | parseSuper(): N.Super { |
nothing calls this directly
no test coverage detected