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

Function parseCallExpressionArguments

packages/babel-parser/src/parser/expression.ts:1089–1124  ·  view source on GitHub ↗
(
    this: Parser,
    allowPlaceholder?: boolean,
    nodeForExtra?: Undone<N.Node> | null,
    refExpressionErrors?: ExpressionErrors | null,
  )

Source from the content-addressed store, hash-verified

1087 }
1088
1089 parseCallExpressionArguments(
1090 this: Parser,
1091 allowPlaceholder?: boolean,
1092 nodeForExtra?: Undone<N.Node> | null,
1093 refExpressionErrors?: ExpressionErrors | null,
1094 ): (N.Expression | N.SpreadElement)[] {
1095 const elts: N.Expression[] = [];
1096 let first = true;
1097
1098 while (!this.eat(tt.parenR)) {
1099 if (first) {
1100 first = false;
1101 } else {
1102 this.expect(tt.comma);
1103 if (this.match(tt.parenR)) {
1104 if (nodeForExtra) {
1105 this.addTrailingCommaExtraToNode(nodeForExtra);
1106 }
1107 this.next();
1108 break;
1109 }
1110 }
1111
1112 const elt = this.parseExprListItem(
1113 tt.parenR,
1114 false,
1115 refExpressionErrors,
1116 allowPlaceholder,
1117 );
1118 // On invalid input `import(,)` and errorRecovery mode,
1119 // the parser will crash if we leave a hole here
1120 if (elt !== null) elts.push(elt);
1121 }
1122
1123 return elts;
1124 }
1125
1126 parseAsyncArrowHead(
1127 startLoc: Position,

Callers

nothing calls this directly

Calls 3

matchMethod · 0.80
nextMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected