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

Function parseNew

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

Source from the content-addressed store, hash-verified

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