MCPcopy Create free account
hub / github.com/babel/babel / parseDoWhileStatement

Function parseDoWhileStatement

packages/babel-parser/src/parser/statement.ts:803–819  ·  view source on GitHub ↗
(
    this: Parser,
    node: Undone<N.DoWhileStatement>,
  )

Source from the content-addressed store, hash-verified

801
802 // https://tc39.es/ecma262/#prod-DoWhileStatement
803 parseDoWhileStatement(
804 this: Parser,
805 node: Undone<N.DoWhileStatement>,
806 ): N.DoWhileStatement {
807 this.next();
808 this.state.labels.push(loopLabel);
809
810 // Parse the loop body's body.
811 node.body = this.parseStatement();
812
813 this.state.labels.pop();
814
815 this.expect(tt._while);
816 node.test = this.parseHeaderExpression();
817 this.eat(tt.semi);
818 return this.finishNode(node, "DoWhileStatement");
819 }
820
821 // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
822 // loop is non-trivial. Basically, we have to parse the init `var`

Callers

nothing calls this directly

Calls 3

nextMethod · 0.80
finishNodeMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected