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

Function finishCallExpression

packages/babel-parser/src/parser/expression.ts:1068–1087  ·  view source on GitHub ↗
(
    node: Undone<T>,
    optional: boolean,
  )

Source from the content-addressed store, hash-verified

1066 }
1067
1068 finishCallExpression<T extends N.CallExpression | N.OptionalCallExpression>(
1069 node: Undone<T>,
1070 optional: boolean,
1071 ): T {
1072 if (node.callee.type === "Import") {
1073 if (node.arguments.length === 0 || node.arguments.length > 2) {
1074 this.raise(Errors.ImportCallArity, node);
1075 } else {
1076 for (const arg of node.arguments) {
1077 if (arg.type === "SpreadElement") {
1078 this.raise(Errors.ImportCallSpreadArgument, arg);
1079 }
1080 }
1081 }
1082 }
1083 return this.finishNode(
1084 node,
1085 optional ? "OptionalCallExpression" : "CallExpression",
1086 );
1087 }
1088
1089 parseCallExpressionArguments(
1090 this: Parser,

Callers

nothing calls this directly

Calls 1

finishNodeMethod · 0.80

Tested by

no test coverage detected