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

Function parseExpressionBase

packages/babel-parser/src/parser/expression.ts:213–229  ·  view source on GitHub ↗
(
    this: Parser,
    refExpressionErrors?: ExpressionErrors,
  )

Source from the content-addressed store, hash-verified

211
212 // https://tc39.es/ecma262/#prod-Expression
213 parseExpressionBase(
214 this: Parser,
215 refExpressionErrors?: ExpressionErrors,
216 ): N.Expression {
217 const startLoc = this.state.startLoc;
218 const expr = this.parseMaybeAssign(refExpressionErrors);
219 if (this.match(tt.comma)) {
220 const node = this.startNodeAt<N.SequenceExpression>(startLoc);
221 node.expressions = [expr];
222 while (this.eat(tt.comma)) {
223 node.expressions.push(this.parseMaybeAssign(refExpressionErrors));
224 }
225 this.toReferencedList(node.expressions);
226 return this.finishNode(node, "SequenceExpression");
227 }
228 return expr;
229 }
230
231 // Set [~In] parameter for assignment expression
232 parseMaybeAssignDisallowIn(

Callers

nothing calls this directly

Calls 5

matchMethod · 0.80
finishNodeMethod · 0.80
parseMaybeAssignMethod · 0.45
pushMethod · 0.45
toReferencedListMethod · 0.45

Tested by

no test coverage detected