meriyah 4.4.3 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/parser.ts CHANGED
@@ -222,12 +222,8 @@ export interface Options {
222
222
  lexical?: boolean;
223
223
  // Adds a source attribute in every node’s loc object when the locations option is `true`
224
224
  source?: string;
225
- // Distinguish Identifier from IdentifierPattern
226
- identifierPattern?: boolean;
227
225
  // Enable React JSX parsing
228
226
  jsx?: boolean;
229
- // Allow edge cases that deviate from the spec
230
- specDeviation?: boolean;
231
227
  // Allows comment extraction. Accepts either a callback function or an array
232
228
  onComment?: OnComment;
233
229
  // Allows detection of automatic semicolon insertion. Accepts a callback function that will be passed the charater offset where the semicolon was inserted
@@ -260,8 +256,6 @@ export function parseSource(source: string, options: Options | void, context: Co
260
256
  if (options.preserveParens) context |= Context.OptionsPreserveParens;
261
257
  if (options.impliedStrict) context |= Context.Strict;
262
258
  if (options.jsx) context |= Context.OptionsJSX;
263
- if (options.identifierPattern) context |= Context.OptionsIdentifierPattern;
264
- if (options.specDeviation) context |= Context.OptionsSpecDeviation;
265
259
  if (options.source) sourceFile = options.source;
266
260
  // Accepts either a callback function to be invoked or an array to collect comments (as the node is constructed)
267
261
  if (options.onComment != null) {
@@ -678,7 +672,7 @@ export function parseExpressionOrLabelledStatement(
678
672
 
679
673
  switch (token) {
680
674
  case Token.LetKeyword:
681
- expr = parseIdentifier(parser, context, 0);
675
+ expr = parseIdentifier(parser, context);
682
676
  if (context & Context.Strict) report(parser, Errors.UnexpectedLetStrictReserved);
683
677
 
684
678
  // "let" followed by either "[", "{" or an identifier means a lexical
@@ -696,7 +690,6 @@ export function parseExpressionOrLabelledStatement(
696
690
  0,
697
691
  1,
698
692
  0,
699
- 0,
700
693
  1,
701
694
  parser.tokenPos,
702
695
  parser.linePos,
@@ -1000,7 +993,7 @@ export function parseAsyncArrowOrAsyncFunctionDeclaration(
1000
993
 
1001
994
  const { token, tokenValue } = parser;
1002
995
 
1003
- let expr: ESTree.Expression = parseIdentifier(parser, context, 0);
996
+ let expr: ESTree.Expression = parseIdentifier(parser, context);
1004
997
 
1005
998
  if (parser.token === Token.Colon) {
1006
999
  return parseLabelledStatement(
@@ -1074,7 +1067,7 @@ export function parseAsyncArrowOrAsyncFunctionDeclaration(
1074
1067
  );
1075
1068
  } else {
1076
1069
  if (parser.token === Token.Arrow) {
1077
- classifyIdentifier(parser, context, token, /* isArrow */ 1);
1070
+ classifyIdentifier(parser, context, token);
1078
1071
  expr = parseArrowFromIdentifier(parser, context, parser.tokenValue, expr, 0, 1, 0, start, line, column);
1079
1072
  }
1080
1073
 
@@ -1513,7 +1506,7 @@ export function parseContinueStatement(
1513
1506
  let label: ESTree.Identifier | undefined | null = null;
1514
1507
  if ((parser.flags & Flags.NewLine) === 0 && parser.token & Token.IsIdentifier) {
1515
1508
  const { tokenValue } = parser;
1516
- label = parseIdentifier(parser, context | Context.AllowRegExp, 0);
1509
+ label = parseIdentifier(parser, context | Context.AllowRegExp);
1517
1510
  if (!isValidLabel(parser, labels, tokenValue, /* requireIterationStatement */ 1))
1518
1511
  report(parser, Errors.UnknownLabel, tokenValue);
1519
1512
  }
@@ -1549,7 +1542,7 @@ export function parseBreakStatement(
1549
1542
  let label: ESTree.Identifier | undefined | null = null;
1550
1543
  if ((parser.flags & Flags.NewLine) === 0 && parser.token & Token.IsIdentifier) {
1551
1544
  const { tokenValue } = parser;
1552
- label = parseIdentifier(parser, context | Context.AllowRegExp, 0);
1545
+ label = parseIdentifier(parser, context | Context.AllowRegExp);
1553
1546
  if (!isValidLabel(parser, labels, tokenValue, /* requireIterationStatement */ 0))
1554
1547
  report(parser, Errors.UnknownLabel, tokenValue);
1555
1548
  } else if ((context & (Context.InSwitch | Context.InIteration)) === 0) {
@@ -1850,7 +1843,7 @@ export function parseDoWhileStatement(
1850
1843
  // ECMA-262, section 11.9
1851
1844
  // The previous token is ) and the inserted semicolon would then be parsed as the terminating semicolon of a do-while statement (13.7.2).
1852
1845
  // This cannot be implemented in matchOrInsertSemicolon() because it doesn't know
1853
- // this RightRaren is the end of a do-while statement.
1846
+ // this RightParen is the end of a do-while statement.
1854
1847
  consumeOpt(parser, context | Context.AllowRegExp, Token.Semicolon);
1855
1848
  return finishNode(parser, context, start, line, column, {
1856
1849
  type: 'DoWhileStatement',
@@ -1884,7 +1877,7 @@ export function parseLetIdentOrVarDeclarationStatement(
1884
1877
  column: number
1885
1878
  ): ESTree.VariableDeclaration | ESTree.LabeledStatement | ESTree.ExpressionStatement {
1886
1879
  const { token, tokenValue } = parser;
1887
- let expr: ESTree.Identifier | ESTree.Expression = parseIdentifier(parser, context, 0);
1880
+ let expr: ESTree.Identifier | ESTree.Expression = parseIdentifier(parser, context);
1888
1881
 
1889
1882
  if (parser.token & (Token.IsIdentifier | Token.IsPatternStart)) {
1890
1883
  /* VariableDeclarations ::
@@ -2120,7 +2113,7 @@ function parseVariableDeclaration(
2120
2113
 
2121
2114
  if (parser.token === Token.Assign) {
2122
2115
  nextToken(parser, context | Context.AllowRegExp);
2123
- init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
2116
+ init = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
2124
2117
  if (origin & Origin.ForStatement || (token & Token.IsPatternStart) === 0) {
2125
2118
  // Lexical declarations in for-in / for-of loops can't be initialized
2126
2119
 
@@ -2197,7 +2190,7 @@ export function parseForStatement(
2197
2190
 
2198
2191
  if (isVarDecl) {
2199
2192
  if (token === Token.LetKeyword) {
2200
- init = parseIdentifier(parser, context, 0);
2193
+ init = parseIdentifier(parser, context);
2201
2194
  if (parser.token & (Token.IsIdentifier | Token.IsPatternStart)) {
2202
2195
  if (parser.token === Token.InKeyword) {
2203
2196
  if (context & Context.Strict) report(parser, Errors.DisallowedLetInStrict);
@@ -2328,7 +2321,7 @@ export function parseForStatement(
2328
2321
  // IterationStatement:
2329
2322
  // for(LeftHandSideExpression of AssignmentExpression) Statement
2330
2323
  // forawait(LeftHandSideExpression of AssignmentExpression) Statement
2331
- right = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
2324
+ right = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
2332
2325
 
2333
2326
  consume(parser, context | Context.AllowRegExp, Token.RightParen);
2334
2327
 
@@ -2418,7 +2411,7 @@ export function parseRestrictedIdentifier(
2418
2411
  if (!isValidIdentifier(context, parser.token)) report(parser, Errors.UnexpectedStrictReserved);
2419
2412
  if ((parser.token & Token.IsEvalOrArguments) === Token.IsEvalOrArguments) report(parser, Errors.StrictEvalArguments);
2420
2413
  if (scope) addBlockName(parser, context, scope, parser.tokenValue, BindingKind.Let, Origin.None);
2421
- return parseIdentifier(parser, context, 0);
2414
+ return parseIdentifier(parser, context);
2422
2415
  }
2423
2416
 
2424
2417
  /**
@@ -2566,7 +2559,9 @@ function parseImportNamespaceSpecifier(
2566
2559
  function parseModuleSpecifier(parser: ParserState, context: Context): ESTree.Literal {
2567
2560
  // ModuleSpecifier :
2568
2561
  // StringLiteral
2569
- consumeOpt(parser, context, Token.FromKeyword);
2562
+ if (!consumeOpt(parser, context, Token.FromKeyword)) {
2563
+ report(parser, Errors.UnexpectedToken, KeywordDescTable[parser.token & Token.Type]);
2564
+ }
2570
2565
 
2571
2566
  if (parser.token !== Token.StringLiteral) report(parser, Errors.InvalidExportImportSource, 'Import');
2572
2567
 
@@ -2596,7 +2591,7 @@ function parseImportSpecifierOrNamedImports(
2596
2591
 
2597
2592
  while (parser.token & Token.IsIdentifier) {
2598
2593
  let { token, tokenValue, tokenPos, linePos, colPos } = parser;
2599
- const imported = parseIdentifier(parser, context, 0);
2594
+ const imported = parseIdentifier(parser, context);
2600
2595
  let local: ESTree.Identifier;
2601
2596
 
2602
2597
  if (consumeOpt(parser, context, Token.AsKeyword)) {
@@ -2606,7 +2601,7 @@ function parseImportSpecifierOrNamedImports(
2606
2601
  validateBindingIdentifier(parser, context, BindingKind.Const, parser.token, 0);
2607
2602
  }
2608
2603
  tokenValue = parser.tokenValue;
2609
- local = parseIdentifier(parser, context, 0);
2604
+ local = parseIdentifier(parser, context);
2610
2605
  } else {
2611
2606
  // Keywords cannot be bound to themselves, so an import name
2612
2607
  // that is a keyword is a syntax error if it is not followed
@@ -2826,7 +2821,7 @@ function parseExportDeclaration(
2826
2821
  case Token.AsyncKeyword:
2827
2822
  const { tokenPos, linePos, colPos } = parser;
2828
2823
 
2829
- declaration = parseIdentifier(parser, context, 0);
2824
+ declaration = parseIdentifier(parser, context);
2830
2825
 
2831
2826
  const { flags } = parser;
2832
2827
 
@@ -2881,7 +2876,7 @@ function parseExportDeclaration(
2881
2876
  } else if (parser.token & Token.IsIdentifier) {
2882
2877
  if (scope) scope = createArrowHeadParsingScope(parser, context, parser.tokenValue);
2883
2878
 
2884
- declaration = parseIdentifier(parser, context, 0);
2879
+ declaration = parseIdentifier(parser, context);
2885
2880
  declaration = parseArrowFunctionExpression(
2886
2881
  parser,
2887
2882
  context,
@@ -2899,7 +2894,7 @@ function parseExportDeclaration(
2899
2894
 
2900
2895
  default:
2901
2896
  // export default [lookahead ∉ {function, class}] AssignmentExpression[In] ;
2902
- declaration = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
2897
+ declaration = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
2903
2898
  matchOrInsertSemicolon(parser, context | Context.AllowRegExp);
2904
2899
  }
2905
2900
 
@@ -2925,7 +2920,7 @@ function parseExportDeclaration(
2925
2920
 
2926
2921
  if (isNamedDeclaration) {
2927
2922
  if (scope) declareUnboundVariable(parser, parser.tokenValue);
2928
- exported = parseIdentifier(parser, context, 0);
2923
+ exported = parseIdentifier(parser, context);
2929
2924
  }
2930
2925
 
2931
2926
  consume(parser, context, Token.FromKeyword);
@@ -2963,7 +2958,7 @@ function parseExportDeclaration(
2963
2958
 
2964
2959
  while (parser.token & Token.IsIdentifier) {
2965
2960
  const { tokenPos, tokenValue, linePos, colPos } = parser;
2966
- const local = parseIdentifier(parser, context, 0);
2961
+ const local = parseIdentifier(parser, context);
2967
2962
 
2968
2963
  let exported: ESTree.Identifier | null;
2969
2964
 
@@ -2976,7 +2971,7 @@ function parseExportDeclaration(
2976
2971
  tmpExportedNames.push(parser.tokenValue);
2977
2972
  tmpExportedBindings.push(tokenValue);
2978
2973
  }
2979
- exported = parseIdentifier(parser, context, 0);
2974
+ exported = parseIdentifier(parser, context);
2980
2975
  } else {
2981
2976
  if (scope) {
2982
2977
  tmpExportedNames.push(parser.tokenValue);
@@ -3126,13 +3121,16 @@ function parseExportDeclaration(
3126
3121
  *
3127
3122
  * @param parser Parser object
3128
3123
  * @param context Context masks
3129
- * @param assignable
3124
+ * @param canAssign
3125
+ * @param inGroup,
3126
+ * @param start,
3127
+ * @param line,
3128
+ * @param column,
3130
3129
  */
3131
3130
  export function parseExpression(
3132
3131
  parser: ParserState,
3133
3132
  context: Context,
3134
3133
  canAssign: 0 | 1,
3135
- isPattern: 0 | 1,
3136
3134
  inGroup: 0 | 1,
3137
3135
  start: number,
3138
3136
  line: number,
@@ -3142,19 +3140,7 @@ export function parseExpression(
3142
3140
  // AssignmentExpression
3143
3141
  // Expression ',' AssignmentExpression
3144
3142
 
3145
- let expr = parsePrimaryExpression(
3146
- parser,
3147
- context,
3148
- BindingKind.Empty,
3149
- 0,
3150
- canAssign,
3151
- isPattern,
3152
- inGroup,
3153
- 1,
3154
- start,
3155
- line,
3156
- column
3157
- );
3143
+ let expr = parsePrimaryExpression(parser, context, BindingKind.Empty, 0, canAssign, inGroup, 1, start, line, column);
3158
3144
 
3159
3145
  expr = parseMemberOrUpdateExpression(parser, context, expr, inGroup, 0, start, line, column);
3160
3146
 
@@ -3182,7 +3168,7 @@ export function parseSequenceExpression(
3182
3168
  // Expression ',' AssignmentExpression
3183
3169
  const expressions: ESTree.Expression[] = [expr];
3184
3170
  while (consumeOpt(parser, context | Context.AllowRegExp, Token.Comma)) {
3185
- expressions.push(parseExpression(parser, context, 1, 0, inGroup, parser.tokenPos, parser.linePos, parser.colPos));
3171
+ expressions.push(parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos));
3186
3172
  }
3187
3173
 
3188
3174
  return finishNode(parser, context, start, line, column, {
@@ -3207,7 +3193,7 @@ export function parseExpressions(
3207
3193
  line: number,
3208
3194
  column: number
3209
3195
  ): ESTree.SequenceExpression | ESTree.Expression {
3210
- const expr = parseExpression(parser, context, canAssign, 0, inGroup, start, line, column);
3196
+ const expr = parseExpression(parser, context, canAssign, inGroup, start, line, column);
3211
3197
  return parser.token === Token.Comma
3212
3198
  ? parseSequenceExpression(parser, context, inGroup, start, line, column, expr)
3213
3199
  : expr;
@@ -3259,7 +3245,7 @@ export function parseAssignmentExpression(
3259
3245
 
3260
3246
  nextToken(parser, context | Context.AllowRegExp);
3261
3247
 
3262
- const right = parseExpression(parser, context, 1, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
3248
+ const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
3263
3249
 
3264
3250
  parser.assignable = AssignmentKind.CannotAssign;
3265
3251
 
@@ -3333,7 +3319,7 @@ export function parseAssignmentExpressionOrPattern(
3333
3319
 
3334
3320
  nextToken(parser, context | Context.AllowRegExp);
3335
3321
 
3336
- const right = parseExpression(parser, context, 1, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
3322
+ const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
3337
3323
 
3338
3324
  left = finishNode(
3339
3325
  parser,
@@ -3383,7 +3369,6 @@ export function parseConditionalExpression(
3383
3369
  (context | Context.DisallowIn) ^ Context.DisallowIn,
3384
3370
  1,
3385
3371
  0,
3386
- 0,
3387
3372
  parser.tokenPos,
3388
3373
  parser.linePos,
3389
3374
  parser.colPos
@@ -3393,7 +3378,7 @@ export function parseConditionalExpression(
3393
3378
  // In parsing the first assignment expression in conditional
3394
3379
  // expressions we always accept the 'in' keyword; see ECMA-262,
3395
3380
  // section 11.12, page 58.
3396
- const alternate = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
3381
+ const alternate = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
3397
3382
  parser.assignable = AssignmentKind.CannotAssign;
3398
3383
  return finishNode(parser, context, start, line, column, {
3399
3384
  type: 'ConditionalExpression',
@@ -3537,14 +3522,13 @@ export function parseAsyncExpression(
3537
3522
  inGroup: 0 | 1,
3538
3523
  isLHS: 0 | 1,
3539
3524
  canAssign: 0 | 1,
3540
- isPattern: 0 | 1,
3541
3525
  inNew: 0 | 1,
3542
3526
  start: number,
3543
3527
  line: number,
3544
3528
  column: number
3545
3529
  ): ESTree.FunctionExpression | ESTree.ArrowFunctionExpression | ESTree.CallExpression | ESTree.Identifier {
3546
3530
  const { token } = parser;
3547
- const expr = parseIdentifier(parser, context, isPattern);
3531
+ const expr = parseIdentifier(parser, context);
3548
3532
  const { flags } = parser;
3549
3533
 
3550
3534
  if ((flags & Flags.NewLine) === 0) {
@@ -3577,7 +3561,7 @@ export function parseAsyncExpression(
3577
3561
  }
3578
3562
 
3579
3563
  if (parser.token === Token.Arrow) {
3580
- classifyIdentifier(parser, context, token, /* isArrow */ 1);
3564
+ classifyIdentifier(parser, context, token);
3581
3565
  if (inNew) report(parser, Errors.InvalidAsyncArrow);
3582
3566
  return parseArrowFromIdentifier(parser, context, parser.tokenValue, expr, inNew, canAssign, 0, start, line, column);
3583
3567
  }
@@ -3619,7 +3603,7 @@ export function parseYieldExpression(
3619
3603
  if ((parser.flags & Flags.NewLine) === 0) {
3620
3604
  delegate = consumeOpt(parser, context | Context.AllowRegExp, Token.Multiply);
3621
3605
  if (parser.token & (Token.Contextual | Token.IsExpressionStart) || delegate) {
3622
- argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
3606
+ argument = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
3623
3607
  }
3624
3608
  }
3625
3609
 
@@ -3856,7 +3840,6 @@ export function parseLeftHandSideExpression(
3856
3840
  BindingKind.Empty,
3857
3841
  0,
3858
3842
  canAssign,
3859
- 0,
3860
3843
  inGroup,
3861
3844
  isLHS,
3862
3845
  start,
@@ -4099,7 +4082,7 @@ export function parseOptionalChain(
4099
4082
  });
4100
4083
  } else {
4101
4084
  if ((parser.token & (Token.IsIdentifier | Token.Keyword)) === 0) report(parser, Errors.InvalidDotProperty);
4102
- const property = parseIdentifier(parser, context, 0);
4085
+ const property = parseIdentifier(parser, context);
4103
4086
  parser.assignable = AssignmentKind.CannotAssign;
4104
4087
  node = finishNode(parser, context, start, line, column, {
4105
4088
  type: 'MemberExpression',
@@ -4129,7 +4112,7 @@ export function parsePropertyOrPrivatePropertyName(parser: ParserState, context:
4129
4112
 
4130
4113
  return context & Context.OptionsNext && parser.token === Token.PrivateField
4131
4114
  ? parsePrivateIdentifier(parser, context, parser.tokenPos, parser.linePos, parser.colPos)
4132
- : parseIdentifier(parser, context, 0);
4115
+ : parseIdentifier(parser, context);
4133
4116
  }
4134
4117
 
4135
4118
  /**
@@ -4186,7 +4169,6 @@ export function parseUpdateExpressionPrefixed(
4186
4169
  * @param kind Binding kind
4187
4170
  * @param inNew
4188
4171
  * @param canAssign
4189
- * @param isPattern
4190
4172
  * @param inGroup
4191
4173
  * @param start
4192
4174
  * @param line
@@ -4199,7 +4181,6 @@ export function parsePrimaryExpression(
4199
4181
  kind: BindingKind,
4200
4182
  inNew: 0 | 1,
4201
4183
  canAssign: 0 | 1,
4202
- isPattern: 0 | 1,
4203
4184
  inGroup: 0 | 1,
4204
4185
  isLHS: 0 | 1,
4205
4186
  start: number,
@@ -4238,17 +4219,17 @@ export function parsePrimaryExpression(
4238
4219
  case Token.YieldKeyword:
4239
4220
  return parseYieldExpression(parser, context, inGroup, canAssign, start, line, column);
4240
4221
  case Token.AsyncKeyword:
4241
- return parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, isPattern, inNew, start, line, column);
4222
+ return parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, inNew, start, line, column);
4242
4223
  default: // ignore
4243
4224
  }
4244
4225
 
4245
4226
  const { token, tokenValue } = parser;
4246
4227
 
4247
- const expr = parseIdentifier(parser, context | Context.TaggedTemplate, isPattern);
4228
+ const expr = parseIdentifier(parser, context | Context.TaggedTemplate);
4248
4229
 
4249
4230
  if (parser.token === Token.Arrow) {
4250
4231
  if (!isLHS) report(parser, Errors.Unexpected);
4251
- classifyIdentifier(parser, context, token, /* isArrow */ 1);
4232
+ classifyIdentifier(parser, context, token);
4252
4233
  return parseArrowFromIdentifier(parser, context, tokenValue, expr, inNew, canAssign, 0, start, line, column);
4253
4234
  }
4254
4235
 
@@ -4359,7 +4340,7 @@ function parseImportCallOrMetaExpression(
4359
4340
  // ImportCall[Yield, Await]:
4360
4341
  // import(AssignmentExpression[+In, ?Yield, ?Await])
4361
4342
 
4362
- let expr: ESTree.Identifier | ESTree.ImportExpression = parseIdentifier(parser, context, 0);
4343
+ let expr: ESTree.Identifier | ESTree.ImportExpression = parseIdentifier(parser, context);
4363
4344
 
4364
4345
  if (parser.token === Token.Period) {
4365
4346
  return parseImportMetaExpression(parser, context, expr, start, line, column);
@@ -4405,7 +4386,7 @@ export function parseImportMetaExpression(
4405
4386
  return finishNode(parser, context, start, line, column, {
4406
4387
  type: 'MetaProperty',
4407
4388
  meta,
4408
- property: parseIdentifier(parser, context, 0)
4389
+ property: parseIdentifier(parser, context)
4409
4390
  });
4410
4391
  }
4411
4392
 
@@ -4432,7 +4413,7 @@ export function parseImportExpression(
4432
4413
 
4433
4414
  if (parser.token === Token.Ellipsis) report(parser, Errors.InvalidSpreadInImport);
4434
4415
 
4435
- const source = parseExpression(parser, context, 1, 0, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
4416
+ const source = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
4436
4417
 
4437
4418
  consume(parser, context, Token.RightParen);
4438
4419
 
@@ -4645,7 +4626,7 @@ function parseSpreadElement(
4645
4626
  ): ESTree.SpreadElement {
4646
4627
  context = (context | Context.DisallowIn) ^ Context.DisallowIn;
4647
4628
  consume(parser, context | Context.AllowRegExp, Token.Ellipsis);
4648
- const argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
4629
+ const argument = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
4649
4630
  parser.assignable = AssignmentKind.Assignable;
4650
4631
  return finishNode(parser, context, start, line, column, {
4651
4632
  type: 'SpreadElement',
@@ -4679,7 +4660,7 @@ export function parseArguments(
4679
4660
  if (parser.token === Token.Ellipsis) {
4680
4661
  args.push(parseSpreadElement(parser, context, parser.tokenPos, parser.linePos, parser.colPos));
4681
4662
  } else {
4682
- args.push(parseExpression(parser, context, 1, 0, inGroup, parser.tokenPos, parser.linePos, parser.colPos));
4663
+ args.push(parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos));
4683
4664
  }
4684
4665
 
4685
4666
  if (parser.token !== Token.Comma) break;
@@ -4700,27 +4681,14 @@ export function parseArguments(
4700
4681
  * @param parser Parser object
4701
4682
  * @param context Context masks
4702
4683
  */
4703
- export function parseIdentifier(parser: ParserState, context: Context, isPattern: 0 | 1): ESTree.Identifier {
4684
+ export function parseIdentifier(parser: ParserState, context: Context): ESTree.Identifier {
4704
4685
  const { tokenValue, tokenPos, linePos, colPos } = parser;
4705
4686
  nextToken(parser, context);
4706
4687
 
4707
- return finishNode(
4708
- parser,
4709
- context,
4710
- tokenPos,
4711
- linePos,
4712
- colPos,
4713
- context & Context.OptionsIdentifierPattern
4714
- ? {
4715
- type: 'Identifier',
4716
- name: tokenValue,
4717
- pattern: isPattern === 1
4718
- }
4719
- : {
4720
- type: 'Identifier',
4721
- name: tokenValue
4722
- }
4723
- );
4688
+ return finishNode(parser, context, tokenPos, linePos, colPos, {
4689
+ type: 'Identifier',
4690
+ name: tokenValue
4691
+ });
4724
4692
  }
4725
4693
 
4726
4694
  /**
@@ -4888,7 +4856,7 @@ export function parseFunctionDeclaration(
4888
4856
  firstRestricted = parser.token;
4889
4857
 
4890
4858
  if (parser.token & Token.IsIdentifier) {
4891
- id = parseIdentifier(parser, context, 0);
4859
+ id = parseIdentifier(parser, context);
4892
4860
  } else {
4893
4861
  report(parser, Errors.UnexpectedToken, KeywordDescTable[parser.token & Token.Type]);
4894
4862
  }
@@ -4969,7 +4937,7 @@ export function parseFunctionExpression(
4969
4937
  if (scope) scope = addChildScope(scope, ScopeKind.FunctionRoot);
4970
4938
 
4971
4939
  firstRestricted = parser.token;
4972
- id = parseIdentifier(parser, context, /* isPattern */ 0);
4940
+ id = parseIdentifier(parser, context);
4973
4941
  }
4974
4942
 
4975
4943
  context =
@@ -5147,7 +5115,7 @@ export function parseArrayExpressionOrPattern(
5147
5115
  const { token, tokenPos, linePos, colPos, tokenValue } = parser;
5148
5116
 
5149
5117
  if (token & Token.IsIdentifier) {
5150
- left = parsePrimaryExpression(parser, context, kind, 0, 1, 0, inGroup, 1, tokenPos, linePos, colPos);
5118
+ left = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
5151
5119
 
5152
5120
  if (parser.token === Token.Assign) {
5153
5121
  if (parser.assignable & AssignmentKind.CannotAssign) report(parser, Errors.CantAssignTo);
@@ -5156,7 +5124,7 @@ export function parseArrayExpressionOrPattern(
5156
5124
 
5157
5125
  if (scope) addVarOrBlock(parser, context, scope, tokenValue, kind, origin);
5158
5126
 
5159
- const right = parseExpression(parser, context, 1, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
5127
+ const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
5160
5128
 
5161
5129
  left = finishNode(
5162
5130
  parser,
@@ -5382,7 +5350,7 @@ function parseArrayOrObjectAssignmentPattern(
5382
5350
 
5383
5351
  const { tokenPos, linePos, colPos } = parser;
5384
5352
 
5385
- const right = parseExpression(parser, context, 1, 1, inGroup, tokenPos, linePos, colPos);
5353
+ const right = parseExpression(parser, context, 1, inGroup, tokenPos, linePos, colPos);
5386
5354
 
5387
5355
  parser.destructible =
5388
5356
  ((destructible | DestructuringKind.SeenProto | DestructuringKind.HasToDestruct) ^
@@ -5449,7 +5417,7 @@ function parseSpreadOrRestElement(
5449
5417
  if (token & (Token.Keyword | Token.IsIdentifier)) {
5450
5418
  parser.assignable = AssignmentKind.Assignable;
5451
5419
 
5452
- argument = parsePrimaryExpression(parser, context, kind, 0, 1, 0, inGroup, 1, tokenPos, linePos, colPos);
5420
+ argument = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
5453
5421
 
5454
5422
  token = parser.token;
5455
5423
 
@@ -5596,7 +5564,7 @@ function parseSpreadOrRestElement(
5596
5564
 
5597
5565
  reinterpretToPattern(parser, argument);
5598
5566
 
5599
- const right = parseExpression(parser, context, 1, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
5567
+ const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
5600
5568
 
5601
5569
  argument = finishNode(
5602
5570
  parser,
@@ -5870,7 +5838,7 @@ export function parseObjectLiteralOrPattern(
5870
5838
  let value;
5871
5839
  const t = parser.token;
5872
5840
  if (parser.token & (Token.IsIdentifier | Token.Keyword) || parser.token === Token.EscapedReserved) {
5873
- key = parseIdentifier(parser, context, 0);
5841
+ key = parseIdentifier(parser, context);
5874
5842
 
5875
5843
  if (parser.token === Token.Comma || parser.token === Token.RightBrace || parser.token === Token.Assign) {
5876
5844
  state |= PropertyKind.Shorthand;
@@ -5886,16 +5854,7 @@ export function parseObjectLiteralOrPattern(
5886
5854
  if (consumeOpt(parser, context | Context.AllowRegExp, Token.Assign)) {
5887
5855
  destructible |= DestructuringKind.HasToDestruct;
5888
5856
 
5889
- const right = parseExpression(
5890
- parser,
5891
- context,
5892
- 1,
5893
- 1,
5894
- inGroup,
5895
- parser.tokenPos,
5896
- parser.linePos,
5897
- parser.colPos
5898
- );
5857
+ const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
5899
5858
 
5900
5859
  destructible |=
5901
5860
  parser.destructible & DestructuringKind.Yield
@@ -5926,7 +5885,7 @@ export function parseObjectLiteralOrPattern(
5926
5885
  // A reserved word is an IdentifierName that cannot be used as an Identifier
5927
5886
  destructible |= t === Token.EscapedReserved ? DestructuringKind.CannotDestruct : 0;
5928
5887
 
5929
- value = parsePrimaryExpression(parser, context, kind, 0, 1, 0, inGroup, 1, tokenPos, linePos, colPos);
5888
+ value = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
5930
5889
 
5931
5890
  const { token } = parser;
5932
5891
 
@@ -6092,7 +6051,7 @@ export function parseObjectLiteralOrPattern(
6092
6051
  if (parser.flags & Flags.NewLine) report(parser, Errors.AsyncRestrictedProd);
6093
6052
  state |= PropertyKind.Async;
6094
6053
  }
6095
- key = parseIdentifier(parser, context, 0);
6054
+ key = parseIdentifier(parser, context);
6096
6055
 
6097
6056
  state |=
6098
6057
  token === Token.GetKeyword
@@ -6139,7 +6098,7 @@ export function parseObjectLiteralOrPattern(
6139
6098
  PropertyKind.Generator | PropertyKind.Method | (token === Token.AsyncKeyword ? PropertyKind.Async : 0);
6140
6099
 
6141
6100
  if (parser.token & Token.IsIdentifier) {
6142
- key = parseIdentifier(parser, context, 0);
6101
+ key = parseIdentifier(parser, context);
6143
6102
  } else if ((parser.token & Token.IsStringOrNumber) === Token.IsStringOrNumber) {
6144
6103
  key = parseLiteral(parser, context);
6145
6104
  } else if (parser.token === Token.LeftBracket) {
@@ -6195,7 +6154,7 @@ export function parseObjectLiteralOrPattern(
6195
6154
  if (tokenValue === '__proto__') prototypeCount++;
6196
6155
 
6197
6156
  if (parser.token & Token.IsIdentifier) {
6198
- value = parsePrimaryExpression(parser, context, kind, 0, 1, 0, inGroup, 1, tokenPos, linePos, colPos);
6157
+ value = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
6199
6158
 
6200
6159
  const { token, tokenValue: valueAfterColon } = parser;
6201
6160
 
@@ -6348,7 +6307,7 @@ export function parseObjectLiteralOrPattern(
6348
6307
  const { tokenPos, linePos, colPos, tokenValue, token: tokenAfterColon } = parser;
6349
6308
 
6350
6309
  if (parser.token & Token.IsIdentifier) {
6351
- value = parsePrimaryExpression(parser, context, kind, 0, 1, 0, inGroup, 1, tokenPos, linePos, colPos);
6310
+ value = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
6352
6311
 
6353
6312
  const { token } = parser;
6354
6313
 
@@ -6505,7 +6464,7 @@ export function parseObjectLiteralOrPattern(
6505
6464
  if (parser.token & Token.IsIdentifier) {
6506
6465
  const { token, line, index } = parser;
6507
6466
 
6508
- key = parseIdentifier(parser, context, 0);
6467
+ key = parseIdentifier(parser, context);
6509
6468
 
6510
6469
  state |= PropertyKind.Method;
6511
6470
 
@@ -6736,7 +6695,7 @@ export function parseMethodFormals(
6736
6695
 
6737
6696
  isSimpleParameterList = 1;
6738
6697
 
6739
- const right = parseExpression(parser, context, 1, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
6698
+ const right = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
6740
6699
 
6741
6700
  left = finishNode(parser, context, tokenPos, linePos, colPos, {
6742
6701
  type: 'AssignmentPattern',
@@ -6783,7 +6742,6 @@ export function parseComputedPropertyName(parser: ParserState, context: Context,
6783
6742
  parser,
6784
6743
  (context | Context.DisallowIn) ^ Context.DisallowIn,
6785
6744
  1,
6786
- 0,
6787
6745
  inGroup,
6788
6746
  parser.tokenPos,
6789
6747
  parser.linePos,
@@ -6848,7 +6806,7 @@ export function parseParenthesizedExpression(
6848
6806
  if (token & (Token.IsIdentifier | Token.Keyword)) {
6849
6807
  if (scope) addBlockName(parser, context, scope, parser.tokenValue, BindingKind.ArgumentList, Origin.None);
6850
6808
 
6851
- expr = parsePrimaryExpression(parser, context, kind, 0, 1, 0, 1, 1, tokenPos, linePos, colPos);
6809
+ expr = parsePrimaryExpression(parser, context, kind, 0, 1, 1, 1, tokenPos, linePos, colPos);
6852
6810
 
6853
6811
  if (parser.token === Token.RightParen || parser.token === Token.Comma) {
6854
6812
  if (parser.assignable & AssignmentKind.CannotAssign) {
@@ -6948,7 +6906,7 @@ export function parseParenthesizedExpression(
6948
6906
  } else {
6949
6907
  destructible |= DestructuringKind.CannotDestruct;
6950
6908
 
6951
- expr = parseExpression(parser, context, 1, 0, 1, tokenPos, linePos, colPos);
6909
+ expr = parseExpression(parser, context, 1, 1, tokenPos, linePos, colPos);
6952
6910
 
6953
6911
  if (isSequence && (parser.token === Token.RightParen || parser.token === Token.Comma)) {
6954
6912
  expressions.push(expr);
@@ -6963,7 +6921,7 @@ export function parseParenthesizedExpression(
6963
6921
 
6964
6922
  if (isSequence) {
6965
6923
  while (consumeOpt(parser, context | Context.AllowRegExp, Token.Comma)) {
6966
- expressions.push(parseExpression(parser, context, 1, 0, 1, parser.tokenPos, parser.linePos, parser.colPos));
6924
+ expressions.push(parseExpression(parser, context, 1, 1, parser.tokenPos, parser.linePos, parser.colPos));
6967
6925
  }
6968
6926
 
6969
6927
  parser.assignable = AssignmentKind.CannotAssign;
@@ -7072,7 +7030,7 @@ export function parseIdentifierOrArrow(
7072
7030
  ): ESTree.Identifier | ESTree.ArrowFunctionExpression {
7073
7031
  const { tokenValue } = parser;
7074
7032
 
7075
- const expr = parseIdentifier(parser, context, 0);
7033
+ const expr = parseIdentifier(parser, context);
7076
7034
  parser.assignable = AssignmentKind.Assignable;
7077
7035
  if (parser.token === Token.Arrow) {
7078
7036
  let scope: ScopeState | undefined = void 0;
@@ -7208,7 +7166,6 @@ export function parseArrowFunctionExpression(
7208
7166
  context & Context.InClass ? context | Context.InMethod : context,
7209
7167
  1,
7210
7168
  0,
7211
- 0,
7212
7169
  parser.tokenPos,
7213
7170
  parser.linePos,
7214
7171
  parser.colPos
@@ -7395,7 +7352,7 @@ export function parseFormalParametersOrFormalList(
7395
7352
 
7396
7353
  isSimpleParameterList = 1;
7397
7354
 
7398
- const right = parseExpression(parser, context, 1, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
7355
+ const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
7399
7356
 
7400
7357
  left = finishNode(parser, context, tokenPos, linePos, colPos, {
7401
7358
  type: 'AssignmentPattern',
@@ -7554,7 +7511,7 @@ export function parseNewExpression(
7554
7511
  // - `new foo()();`
7555
7512
  // - `new (await foo);`
7556
7513
  // - `new x(await foo);`
7557
- const id = parseIdentifier(parser, context | Context.AllowRegExp, 0);
7514
+ const id = parseIdentifier(parser, context | Context.AllowRegExp);
7558
7515
  const { tokenPos, linePos, colPos } = parser;
7559
7516
 
7560
7517
  if (consumeOpt(parser, context, Token.Period)) {
@@ -7572,19 +7529,7 @@ export function parseNewExpression(
7572
7529
  report(parser, Errors.InvalidNewUnary, KeywordDescTable[parser.token & Token.Type]);
7573
7530
  }
7574
7531
 
7575
- const expr = parsePrimaryExpression(
7576
- parser,
7577
- context,
7578
- BindingKind.Empty,
7579
- 1,
7580
- 0,
7581
- 0,
7582
- inGroup,
7583
- 1,
7584
- tokenPos,
7585
- linePos,
7586
- colPos
7587
- );
7532
+ const expr = parsePrimaryExpression(parser, context, BindingKind.Empty, 1, 0, inGroup, 1, tokenPos, linePos, colPos);
7588
7533
 
7589
7534
  context = (context | Context.DisallowIn) ^ Context.DisallowIn;
7590
7535
 
@@ -7619,7 +7564,7 @@ export function parseMetaProperty(
7619
7564
  line: number,
7620
7565
  column: number
7621
7566
  ): ESTree.MetaProperty {
7622
- const property = parseIdentifier(parser, context, 0);
7567
+ const property = parseIdentifier(parser, context);
7623
7568
  return finishNode(parser, context, start, line, column, {
7624
7569
  type: 'MetaProperty',
7625
7570
  meta,
@@ -7668,7 +7613,7 @@ function parseAsyncArrowAfterIdent(
7668
7613
  parser,
7669
7614
  context,
7670
7615
  parser.tokenValue,
7671
- parseIdentifier(parser, context, 0),
7616
+ parseIdentifier(parser, context),
7672
7617
  0,
7673
7618
  canAssign,
7674
7619
  1,
@@ -7740,7 +7685,7 @@ export function parseAsyncArrowOrCallExpression(
7740
7685
  if (token & (Token.IsIdentifier | Token.Keyword)) {
7741
7686
  if (scope) addBlockName(parser, context, scope, parser.tokenValue, kind, Origin.None);
7742
7687
 
7743
- expr = parsePrimaryExpression(parser, context, kind, 0, 1, 0, 1, 1, tokenPos, linePos, colPos);
7688
+ expr = parsePrimaryExpression(parser, context, kind, 0, 1, 1, 1, tokenPos, linePos, colPos);
7744
7689
 
7745
7690
  if (parser.token === Token.RightParen || parser.token === Token.Comma) {
7746
7691
  if (parser.assignable & AssignmentKind.CannotAssign) {
@@ -7817,14 +7762,14 @@ export function parseAsyncArrowOrCallExpression(
7817
7762
 
7818
7763
  isSimpleParameterList = 1;
7819
7764
  } else {
7820
- expr = parseExpression(parser, context, 1, 0, 0, tokenPos, linePos, colPos);
7765
+ expr = parseExpression(parser, context, 1, 0, tokenPos, linePos, colPos);
7821
7766
 
7822
7767
  destructible = parser.assignable;
7823
7768
 
7824
7769
  params.push(expr);
7825
7770
 
7826
7771
  while (consumeOpt(parser, context | Context.AllowRegExp, Token.Comma)) {
7827
- params.push(parseExpression(parser, context, 1, 0, 0, tokenPos, linePos, colPos));
7772
+ params.push(parseExpression(parser, context, 1, 0, tokenPos, linePos, colPos));
7828
7773
  }
7829
7774
 
7830
7775
  destructible |= parser.assignable;
@@ -7982,7 +7927,7 @@ export function parseClassDeclaration(
7982
7927
  }
7983
7928
  }
7984
7929
 
7985
- id = parseIdentifier(parser, context, 0);
7930
+ id = parseIdentifier(parser, context);
7986
7931
  } else {
7987
7932
  // Only under the "export default" context, class declaration does not require the class name.
7988
7933
  //
@@ -8072,7 +8017,7 @@ export function parseClassExpression(
8072
8017
  report(parser, Errors.StrictEvalArguments);
8073
8018
  }
8074
8019
 
8075
- id = parseIdentifier(parser, context, 0);
8020
+ id = parseIdentifier(parser, context);
8076
8021
  }
8077
8022
 
8078
8023
  // Second set of context masks to fix 'super' edge cases
@@ -8156,7 +8101,7 @@ export function parseDecoratorList(
8156
8101
  ): ESTree.Decorator {
8157
8102
  nextToken(parser, context | Context.AllowRegExp);
8158
8103
 
8159
- let expression = parsePrimaryExpression(parser, context, BindingKind.Empty, 0, 1, 0, 0, 1, start, line, column);
8104
+ let expression = parsePrimaryExpression(parser, context, BindingKind.Empty, 0, 1, 0, 1, start, line, column);
8160
8105
 
8161
8106
  expression = parseMemberOrUpdateExpression(parser, context, expression, 0, 0, start, line, column);
8162
8107
 
@@ -8321,7 +8266,7 @@ function parseClassElementList(
8321
8266
  const { token, tokenPos, linePos, colPos } = parser;
8322
8267
 
8323
8268
  if (token & (Token.IsIdentifier | Token.FutureReserved)) {
8324
- key = parseIdentifier(parser, context, 0);
8269
+ key = parseIdentifier(parser, context);
8325
8270
 
8326
8271
  switch (token) {
8327
8272
  case Token.StaticKeyword:
@@ -8393,7 +8338,7 @@ function parseClassElementList(
8393
8338
  } else if (isStatic && token === Token.LeftBrace) {
8394
8339
  return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
8395
8340
  } else if (token === Token.EscapedFutureReserved) {
8396
- key = parseIdentifier(parser, context, 0);
8341
+ key = parseIdentifier(parser, context);
8397
8342
  if (parser.token !== Token.LeftParen)
8398
8343
  report(parser, Errors.UnexpectedToken, KeywordDescTable[parser.token & Token.Type]);
8399
8344
  } else {
@@ -8402,14 +8347,14 @@ function parseClassElementList(
8402
8347
 
8403
8348
  if (kind & (PropertyKind.Generator | PropertyKind.Async | PropertyKind.GetSet)) {
8404
8349
  if (parser.token & Token.IsIdentifier) {
8405
- key = parseIdentifier(parser, context, 0);
8350
+ key = parseIdentifier(parser, context);
8406
8351
  } else if ((parser.token & Token.IsStringOrNumber) === Token.IsStringOrNumber) {
8407
8352
  key = parseLiteral(parser, context);
8408
8353
  } else if (parser.token === Token.LeftBracket) {
8409
8354
  kind |= PropertyKind.Computed;
8410
8355
  key = parseComputedPropertyName(parser, context, /* inGroup */ 0);
8411
8356
  } else if (parser.token === Token.EscapedFutureReserved) {
8412
- key = parseIdentifier(parser, context, 0);
8357
+ key = parseIdentifier(parser, context);
8413
8358
  } else if (context & Context.OptionsNext && parser.token === Token.PrivateField) {
8414
8359
  kind |= PropertyKind.PrivateField;
8415
8360
  key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
@@ -8565,7 +8510,6 @@ export function parsePropertyDefinition(
8565
8510
  0,
8566
8511
  1,
8567
8512
  0,
8568
- 0,
8569
8513
  1,
8570
8514
  tokenPos,
8571
8515
  linePos,
@@ -9056,7 +9000,7 @@ export function parseJSXSpreadAttribute(
9056
9000
  ): ESTree.JSXSpreadAttribute {
9057
9001
  nextToken(parser, context); // skips: '{'
9058
9002
  consume(parser, context, Token.Ellipsis);
9059
- const expression = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
9003
+ const expression = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
9060
9004
  consume(parser, context, Token.RightBrace);
9061
9005
  return finishNode(parser, context, start, line, column, {
9062
9006
  type: 'JSXSpreadAttribute',
@@ -9173,7 +9117,7 @@ function parseJSXExpressionContainer(
9173
9117
  if (isAttr) report(parser, Errors.InvalidNonEmptyJSXExpr);
9174
9118
  expression = parseJSXEmptyExpression(parser, context, parser.startPos, parser.startLine, parser.startColumn);
9175
9119
  } else {
9176
- expression = parseExpression(parser, context, 1, 0, 0, tokenPos, linePos, colPos);
9120
+ expression = parseExpression(parser, context, 1, 0, tokenPos, linePos, colPos);
9177
9121
  }
9178
9122
  if (inJSXChild) {
9179
9123
  consume(parser, context, Token.RightBrace);
@@ -9204,7 +9148,7 @@ function parseJSXSpreadChild(
9204
9148
  column: number
9205
9149
  ): ESTree.JSXSpreadChild {
9206
9150
  consume(parser, context, Token.Ellipsis);
9207
- const expression = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
9151
+ const expression = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
9208
9152
  consume(parser, context, Token.RightBrace);
9209
9153
  return finishNode(parser, context, start, line, column, {
9210
9154
  type: 'JSXSpreadChild',