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

Function parseNew

packages/babel-parser/src/parser/expression.ts:1984–1997  ·  view source on GitHub ↗
(this: Parser, node: Undone<N.NewExpression>)

Source from the content-addressed store, hash-verified

1982 // argument list.
1983 // https://tc39.es/ecma262/#prod-NewExpression
1984 parseNew(this: Parser, node: Undone<N.NewExpression>): N.NewExpression {
1985 this.parseNewCallee(node);
1986
1987 if (this.eat(tt.parenL)) {
1988 const args = this.parseExprList(tt.parenR);
1989 this.toReferencedList(args);
1990 // (parseExprList should be all non-null in this case)
1991 node.arguments = args as N.Expression[];
1992 } else {
1993 node.arguments = [];
1994 }
1995
1996 return this.finishNode(node, "NewExpression");
1997 }
1998
1999 parseNewCallee(this: Parser, node: Undone<N.NewExpression>): void {
2000 const callee = this.parseNoCallExpr(base => {

Callers

nothing calls this directly

Calls 3

finishNodeMethod · 0.80
parseNewCalleeMethod · 0.45
toReferencedListMethod · 0.45

Tested by

no test coverage detected