meriyah 7.2.0 → 7.3.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/dist/meriyah.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var version$1 = "7.2.0";
1
+ var version$1 = "7.3.0";
2
2
  var packageJson = {
3
3
  version: version$1};
4
4
 
@@ -621,7 +621,7 @@ const errorMessages = {
621
621
  [9]: 'Octal literals are not allowed in strict mode',
622
622
  [8]: 'Decimal integer literals with a leading zero are forbidden in strict mode',
623
623
  [10]: 'Expected number in radix %0',
624
- [151]: 'Invalid left-hand side assignment to a destructible right-hand side',
624
+ [153]: 'Invalid left-hand side assignment to a destructible right-hand side',
625
625
  [11]: 'Non-number found after exponent indicator',
626
626
  [12]: 'Invalid BigIntLiteral',
627
627
  [13]: 'No identifiers allowed directly after numeric literal',
@@ -645,7 +645,7 @@ const errorMessages = {
645
645
  [32]: 'Yield expression not allowed in formal parameter',
646
646
  [95]: "Unexpected token: 'escaped keyword'",
647
647
  [33]: 'Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses',
648
- [123]: 'Async functions can only be declared at the top level or inside a block',
648
+ [125]: 'Async functions can only be declared at the top level or inside a block',
649
649
  [34]: 'Unterminated regular expression',
650
650
  [35]: 'Unexpected regular expression flag',
651
651
  [36]: "Duplicate regular expression flag '%0'",
@@ -657,7 +657,7 @@ const errorMessages = {
657
657
  [42]: 'A getter cannot be a generator',
658
658
  [43]: 'A setter cannot be a generator',
659
659
  [44]: 'A computed property name must be followed by a colon or paren',
660
- [134]: 'Object literal keys that are strings or numbers must be a method or have a colon',
660
+ [136]: 'Object literal keys that are strings or numbers must be a method or have a colon',
661
661
  [46]: 'Found `* async x(){}` but this should be `async * x(){}`',
662
662
  [45]: 'Getters and setters can not be generators',
663
663
  [47]: "'%0' can not be generator method",
@@ -719,73 +719,75 @@ const errorMessages = {
719
719
  [105]: '%0 source must be string',
720
720
  [106]: 'Only a identifier or string can be used to indicate alias',
721
721
  [107]: "Only '*' or '{...}' can be imported after default",
722
- [108]: 'Trailing decorator may be followed by method',
723
- [109]: "Decorators can't be used with a constructor",
724
- [110]: 'Can not use `await` as identifier in module or async func',
725
- [111]: 'Can not use `await` as identifier in module',
726
- [112]: 'HTML comments are only allowed with web compatibility (Annex B)',
727
- [113]: "The identifier 'let' must not be in expression position in strict mode",
728
- [114]: 'Cannot assign to `eval` and `arguments` in strict mode',
729
- [115]: "The left-hand side of a for-of loop may not start with 'let'",
730
- [116]: 'Block body arrows can not be immediately invoked without a group',
731
- [117]: 'Block body arrows can not be immediately accessed without a group',
732
- [118]: 'Unexpected strict mode reserved word',
733
- [119]: 'Unexpected eval or arguments in strict mode',
734
- [120]: 'Decorators must not be followed by a semicolon',
735
- [121]: 'Calling delete on expression not allowed in strict mode',
736
- [122]: 'Pattern can not have a tail',
737
- [124]: 'Can not have a `yield` expression on the left side of a ternary',
738
- [125]: 'An arrow function can not have a postfix update operator',
739
- [126]: 'Invalid object literal key character after generator star',
740
- [127]: 'Private fields can not be deleted',
741
- [129]: 'Classes may not have a field called constructor',
742
- [128]: 'Classes may not have a private element named constructor',
743
- [130]: 'A class field initializer or static block may not contain arguments',
744
- [131]: 'Generators can only be declared at the top level or inside a block',
745
- [132]: 'Async methods are a restricted production and cannot have a newline following it',
746
- [133]: 'Unexpected character after object literal property name',
747
- [135]: 'Invalid key token',
748
- [136]: "Label '%0' has already been declared",
749
- [137]: 'continue statement must be nested within an iteration statement',
750
- [138]: "Undefined label '%0'",
751
- [139]: 'Trailing comma is disallowed inside import(...) arguments',
752
- [140]: 'Invalid binding in JSON import',
753
- [141]: 'import() requires exactly one argument',
754
- [142]: 'Cannot use new with import(...)',
755
- [143]: '... is not allowed in import()',
756
- [144]: "Expected '=>'",
757
- [145]: "Duplicate binding '%0'",
758
- [146]: 'Duplicate private identifier #%0',
759
- [147]: "Cannot export a duplicate name '%0'",
760
- [150]: 'Duplicate %0 for-binding',
761
- [148]: "Exported binding '%0' needs to refer to a top-level declared variable",
762
- [149]: 'Unexpected private field',
763
- [153]: 'Numeric separators are not allowed at the end of numeric literals',
764
- [152]: 'Only one underscore is allowed as numeric separator',
765
- [154]: 'JSX value should be either an expression or a quoted JSX text',
766
- [155]: 'Expected corresponding JSX closing tag for %0',
767
- [156]: 'Adjacent JSX elements must be wrapped in an enclosing tag',
768
- [157]: "JSX attributes must only be assigned a non-empty 'expression'",
769
- [158]: "'%0' has already been declared",
770
- [159]: "'%0' shadowed a catch clause binding",
771
- [160]: 'Dot property must be an identifier',
772
- [161]: 'Encountered invalid input after spread/rest argument',
773
- [162]: 'Catch without try',
774
- [163]: 'Finally without try',
775
- [164]: 'Expected corresponding closing tag for JSX fragment',
776
- [165]: 'Coalescing and logical operators used together in the same expression must be disambiguated with parentheses',
777
- [166]: 'Invalid tagged template on optional chain',
778
- [167]: 'Invalid optional chain from super property',
779
- [168]: 'Invalid optional chain from new expression',
780
- [169]: 'Cannot use "import.meta" outside a module',
781
- [170]: 'Leading decorators must be attached to a class declaration',
782
- [171]: 'An export name cannot include a lone surrogate',
783
- [172]: 'A string literal cannot be used as an exported binding without `from`',
784
- [173]: "Private fields can't be accessed on super",
785
- [174]: "The only valid meta property for import is 'import.meta'",
786
- [175]: "'import.meta' must not contain escaped characters",
787
- [176]: 'cannot use "await" as identifier inside an async function',
788
- [177]: 'cannot use "await" in static blocks',
722
+ [108]: "'import defer' must be followed by a namespace import",
723
+ [109]: "'import source' must be followed by a default import",
724
+ [110]: 'Trailing decorator may be followed by method',
725
+ [111]: "Decorators can't be used with a constructor",
726
+ [112]: 'Can not use `await` as identifier in module or async func',
727
+ [113]: 'Can not use `await` as identifier in module',
728
+ [114]: 'HTML comments are only allowed with web compatibility (Annex B)',
729
+ [115]: "The identifier 'let' must not be in expression position in strict mode",
730
+ [116]: 'Cannot assign to `eval` and `arguments` in strict mode',
731
+ [117]: "The left-hand side of a for-of loop may not start with 'let'",
732
+ [118]: 'Block body arrows can not be immediately invoked without a group',
733
+ [119]: 'Block body arrows can not be immediately accessed without a group',
734
+ [120]: 'Unexpected strict mode reserved word',
735
+ [121]: 'Unexpected eval or arguments in strict mode',
736
+ [122]: 'Decorators must not be followed by a semicolon',
737
+ [123]: 'Calling delete on expression not allowed in strict mode',
738
+ [124]: 'Pattern can not have a tail',
739
+ [126]: 'Can not have a `yield` expression on the left side of a ternary',
740
+ [127]: 'An arrow function can not have a postfix update operator',
741
+ [128]: 'Invalid object literal key character after generator star',
742
+ [129]: 'Private fields can not be deleted',
743
+ [131]: 'Classes may not have a field called constructor',
744
+ [130]: 'Classes may not have a private element named constructor',
745
+ [132]: 'A class field initializer or static block may not contain arguments',
746
+ [133]: 'Generators can only be declared at the top level or inside a block',
747
+ [134]: 'Async methods are a restricted production and cannot have a newline following it',
748
+ [135]: 'Unexpected character after object literal property name',
749
+ [137]: 'Invalid key token',
750
+ [138]: "Label '%0' has already been declared",
751
+ [139]: 'continue statement must be nested within an iteration statement',
752
+ [140]: "Undefined label '%0'",
753
+ [141]: 'Trailing comma is disallowed inside import(...) arguments',
754
+ [142]: 'Invalid binding in JSON import',
755
+ [143]: 'import() requires exactly one argument',
756
+ [144]: 'Cannot use new with import(...)',
757
+ [145]: '... is not allowed in import()',
758
+ [146]: "Expected '=>'",
759
+ [147]: "Duplicate binding '%0'",
760
+ [148]: 'Duplicate private identifier #%0',
761
+ [149]: "Cannot export a duplicate name '%0'",
762
+ [152]: 'Duplicate %0 for-binding',
763
+ [150]: "Exported binding '%0' needs to refer to a top-level declared variable",
764
+ [151]: 'Unexpected private field',
765
+ [155]: 'Numeric separators are not allowed at the end of numeric literals',
766
+ [154]: 'Only one underscore is allowed as numeric separator',
767
+ [156]: 'JSX value should be either an expression or a quoted JSX text',
768
+ [157]: 'Expected corresponding JSX closing tag for %0',
769
+ [158]: 'Adjacent JSX elements must be wrapped in an enclosing tag',
770
+ [159]: "JSX attributes must only be assigned a non-empty 'expression'",
771
+ [160]: "'%0' has already been declared",
772
+ [161]: "'%0' shadowed a catch clause binding",
773
+ [162]: 'Dot property must be an identifier',
774
+ [163]: 'Encountered invalid input after spread/rest argument',
775
+ [164]: 'Catch without try',
776
+ [165]: 'Finally without try',
777
+ [166]: 'Expected corresponding closing tag for JSX fragment',
778
+ [167]: 'Coalescing and logical operators used together in the same expression must be disambiguated with parentheses',
779
+ [168]: 'Invalid tagged template on optional chain',
780
+ [169]: 'Invalid optional chain from super property',
781
+ [170]: 'Invalid optional chain from new expression',
782
+ [171]: 'Cannot use "import.meta" outside a module',
783
+ [172]: 'Leading decorators must be attached to a class declaration',
784
+ [173]: 'An export name cannot include a lone surrogate',
785
+ [174]: 'A string literal cannot be used as an exported binding without `from`',
786
+ [175]: "Private fields can't be accessed on super",
787
+ [176]: "The only valid meta property for import is 'import.meta'",
788
+ [177]: "'import.meta' must not contain escaped characters",
789
+ [178]: 'cannot use "await" as identifier inside an async function',
790
+ [179]: 'cannot use "await" in static blocks',
789
791
  };
790
792
  class ParseError extends SyntaxError {
791
793
  start;
@@ -809,10 +811,6 @@ class ParseError extends SyntaxError {
809
811
  }
810
812
  const isParseError = (error) => error instanceof ParseError;
811
813
 
812
- function getOwnProperty(object, key) {
813
- return Object.hasOwn(object, key) ? object[key] : undefined;
814
- }
815
-
816
814
  const KeywordDescTable = [
817
815
  'end of source',
818
816
  'identifier', 'number', 'string', 'regular expression',
@@ -834,75 +832,82 @@ const KeywordDescTable = [
834
832
  'BigIntLiteral', '??', '?.', 'WhiteSpace', 'Illegal', 'LineTerminator', 'PrivateField',
835
833
  'Template', '@', 'target', 'meta', 'LineFeed', 'Escaped', 'JSXText'
836
834
  ];
837
- const descKeywordTable = {
838
- this: 86111,
839
- function: 86104,
840
- if: 20569,
841
- return: 20572,
842
- var: 86088,
843
- else: 20563,
844
- for: 20567,
845
- new: 86107,
846
- in: 8673330,
847
- typeof: 16863275,
848
- while: 20578,
849
- case: 20556,
850
- break: 20555,
851
- try: 20577,
852
- catch: 20557,
853
- delete: 16863276,
854
- throw: 86112,
855
- switch: 86110,
856
- continue: 20559,
857
- default: 20561,
858
- instanceof: 8411187,
859
- do: 20562,
860
- void: 16863277,
861
- finally: 20566,
862
- async: 209005,
863
- await: 209006,
864
- class: 86094,
865
- const: 86090,
866
- constructor: 12399,
867
- debugger: 20560,
868
- export: 20564,
869
- extends: 20565,
870
- false: 86021,
871
- from: 209011,
872
- get: 209008,
873
- implements: 36964,
874
- import: 86106,
875
- interface: 36965,
876
- let: 241737,
877
- null: 86023,
878
- of: 471156,
879
- using: 209013,
880
- package: 36966,
881
- private: 36967,
882
- protected: 36968,
883
- public: 36969,
884
- set: 209009,
885
- static: 36970,
886
- super: 86109,
887
- true: 86022,
888
- with: 20579,
889
- yield: 241771,
890
- enum: 86134,
891
- eval: 537079927,
892
- as: 77932,
893
- arguments: 537079928,
894
- target: 209030,
895
- meta: 209031,
896
- accessor: 12402,
897
- };
835
+ const descKeywordTable = new Map([
836
+ ['this', 86111],
837
+ ['function', 86104],
838
+ ['if', 20569],
839
+ ['return', 20572],
840
+ ['var', 86088],
841
+ ['else', 20563],
842
+ ['for', 20567],
843
+ ['new', 86107],
844
+ ['in', 8673330],
845
+ ['typeof', 16863275],
846
+ ['while', 20578],
847
+ ['case', 20556],
848
+ ['break', 20555],
849
+ ['try', 20577],
850
+ ['catch', 20557],
851
+ ['delete', 16863276],
852
+ ['throw', 86112],
853
+ ['switch', 86110],
854
+ ['continue', 20559],
855
+ ['default', 20561],
856
+ ['instanceof', 8411187],
857
+ ['do', 20562],
858
+ ['void', 16863277],
859
+ ['finally', 20566],
860
+ ['async', 209005],
861
+ ['await', 209006],
862
+ ['class', 86094],
863
+ ['const', 86090],
864
+ ['constructor', 12399],
865
+ ['debugger', 20560],
866
+ ['export', 20564],
867
+ ['extends', 20565],
868
+ ['false', 86021],
869
+ ['from', 209011],
870
+ ['get', 209008],
871
+ ['implements', 36964],
872
+ ['import', 86106],
873
+ ['interface', 36965],
874
+ ['let', 241737],
875
+ ['null', 86023],
876
+ ['of', 471156],
877
+ ['using', 209013],
878
+ ['package', 36966],
879
+ ['private', 36967],
880
+ ['protected', 36968],
881
+ ['public', 36969],
882
+ ['set', 209009],
883
+ ['static', 36970],
884
+ ['super', 86109],
885
+ ['true', 86022],
886
+ ['with', 20579],
887
+ ['yield', 241771],
888
+ ['enum', 86134],
889
+ ['eval', 537079927],
890
+ ['as', 77932],
891
+ ['arguments', 537079928],
892
+ ['target', 209030],
893
+ ['meta', 209031],
894
+ ['accessor', 12402],
895
+ ]);
896
+ const keywordLengths = [...descKeywordTable.keys()].map((keyword) => keyword.length);
897
+ const minKeywordLength = Math.min(...keywordLengths);
898
+ const maxKeywordLength = Math.max(...keywordLengths);
898
899
 
899
900
  function scanIdentifier(parser, context, isValidAsKeyword) {
900
901
  while (isIdPart[advanceChar(parser)])
901
902
  ;
902
903
  parser.tokenValue = parser.source.slice(parser.tokenIndex, parser.index);
903
- return parser.currentChar !== 92 && parser.currentChar <= 0x7e
904
- ? (getOwnProperty(descKeywordTable, parser.tokenValue) ?? 208897)
905
- : scanIdentifierSlowCase(parser, context, 0, isValidAsKeyword);
904
+ if (parser.currentChar === 92 || parser.currentChar > 0x7e) {
905
+ return scanIdentifierSlowCase(parser, context, 0, isValidAsKeyword);
906
+ }
907
+ const length = parser.index - parser.tokenIndex;
908
+ if (length < minKeywordLength || length > maxKeywordLength)
909
+ return 208897;
910
+ return descKeywordTable.get(parser.tokenValue) ?? 208897;
906
911
  }
907
912
  function scanUnicodeIdentifier(parser, context) {
908
913
  const cookedChar = scanIdentifierUnicodeEscape(parser);
@@ -944,8 +949,8 @@ function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {
944
949
  parser.tokenValue += parser.source.slice(start, parser.index);
945
950
  }
946
951
  const { length } = parser.tokenValue;
947
- if (isValidAsKeyword && length >= 2 && length <= 11) {
948
- const token = getOwnProperty(descKeywordTable, parser.tokenValue);
952
+ if (isValidAsKeyword && length >= minKeywordLength && length <= maxKeywordLength) {
953
+ const token = descKeywordTable.get(parser.tokenValue);
949
954
  if (token === void 0)
950
955
  return 208897 | (hasEscape ? -2147483648 : 0);
951
956
  if (!hasEscape)
@@ -1069,7 +1074,7 @@ function scanNumber(parser, context, kind) {
1069
1074
  while (CharTypes[char] & (64 | 4096)) {
1070
1075
  if (char === 95) {
1071
1076
  if (!allowSeparator)
1072
- parser.report(152);
1077
+ parser.report(154);
1073
1078
  allowSeparator = 0;
1074
1079
  char = advanceChar(parser);
1075
1080
  continue;
@@ -1080,7 +1085,7 @@ function scanNumber(parser, context, kind) {
1080
1085
  char = advanceChar(parser);
1081
1086
  }
1082
1087
  if (digits === 0 || !allowSeparator) {
1083
- parser.report(digits === 0 ? 21 : 153);
1088
+ parser.report(digits === 0 ? 21 : 155);
1084
1089
  }
1085
1090
  }
1086
1091
  else if ((char | 32) === 111) {
@@ -1089,7 +1094,7 @@ function scanNumber(parser, context, kind) {
1089
1094
  while (CharTypes[char] & (32 | 4096)) {
1090
1095
  if (char === 95) {
1091
1096
  if (!allowSeparator) {
1092
- parser.report(152);
1097
+ parser.report(154);
1093
1098
  }
1094
1099
  allowSeparator = 0;
1095
1100
  char = advanceChar(parser);
@@ -1101,7 +1106,7 @@ function scanNumber(parser, context, kind) {
1101
1106
  char = advanceChar(parser);
1102
1107
  }
1103
1108
  if (digits === 0 || !allowSeparator) {
1104
- parser.report(digits === 0 ? 0 : 153);
1109
+ parser.report(digits === 0 ? 0 : 155);
1105
1110
  }
1106
1111
  }
1107
1112
  else if ((char | 32) === 98) {
@@ -1110,7 +1115,7 @@ function scanNumber(parser, context, kind) {
1110
1115
  while (CharTypes[char] & (128 | 4096)) {
1111
1116
  if (char === 95) {
1112
1117
  if (!allowSeparator) {
1113
- parser.report(152);
1118
+ parser.report(154);
1114
1119
  }
1115
1120
  allowSeparator = 0;
1116
1121
  char = advanceChar(parser);
@@ -1122,7 +1127,7 @@ function scanNumber(parser, context, kind) {
1122
1127
  char = advanceChar(parser);
1123
1128
  }
1124
1129
  if (digits === 0 || !allowSeparator) {
1125
- parser.report(digits === 0 ? 0 : 153);
1130
+ parser.report(digits === 0 ? 0 : 155);
1126
1131
  }
1127
1132
  }
1128
1133
  else if (CharTypes[char] & 32) {
@@ -1155,7 +1160,7 @@ function scanNumber(parser, context, kind) {
1155
1160
  if (char === 95) {
1156
1161
  char = advanceChar(parser);
1157
1162
  if (char === 95 || kind & 32) {
1158
- throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152);
1163
+ throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 154);
1159
1164
  }
1160
1165
  allowSeparator = 1;
1161
1166
  continue;
@@ -1166,7 +1171,7 @@ function scanNumber(parser, context, kind) {
1166
1171
  --digit;
1167
1172
  }
1168
1173
  if (allowSeparator) {
1169
- throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153);
1174
+ throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 155);
1170
1175
  }
1171
1176
  if (digit >= 0 && !isIdentifierStart(char) && char !== 46) {
1172
1177
  parser.tokenValue = value;
@@ -1231,7 +1236,7 @@ function scanDecimalDigitsOrSeparator(parser, char) {
1231
1236
  const { index } = parser;
1232
1237
  char = advanceChar(parser);
1233
1238
  if (char === 95) {
1234
- throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152);
1239
+ throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 154);
1235
1240
  }
1236
1241
  allowSeparator = 1;
1237
1242
  ret += parser.source.substring(start, index);
@@ -1242,7 +1247,7 @@ function scanDecimalDigitsOrSeparator(parser, char) {
1242
1247
  char = advanceChar(parser);
1243
1248
  }
1244
1249
  if (allowSeparator) {
1245
- throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153);
1250
+ throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 155);
1246
1251
  }
1247
1252
  return ret + parser.source.substring(start, parser.index);
1248
1253
  }
@@ -1963,7 +1968,7 @@ function scanSingleToken(parser, context, state) {
1963
1968
  advanceChar(parser);
1964
1969
  if ((state & 1 || isStartOfLine) && parser.currentChar === 62) {
1965
1970
  if (!parser.options.webcompat)
1966
- parser.report(112);
1971
+ parser.report(114);
1967
1972
  advanceChar(parser);
1968
1973
  state = skipSingleHTMLComment(parser, source, state, context, 3, parser.tokenStart);
1969
1974
  continue;
@@ -2192,10 +2197,10 @@ function reinterpretToPattern(parser, node) {
2192
2197
  function validateBindingIdentifier(parser, context, kind, t, skipEvalArgCheck) {
2193
2198
  if (context & 1) {
2194
2199
  if ((t & 36864) === 36864) {
2195
- parser.report(118);
2200
+ parser.report(120);
2196
2201
  }
2197
2202
  if (!skipEvalArgCheck && (t & 537079808) === 537079808) {
2198
- parser.report(119);
2203
+ parser.report(121);
2199
2204
  }
2200
2205
  }
2201
2206
  if ((t & 20480) === 20480 || t === -2147483527) {
@@ -2205,7 +2210,7 @@ function validateBindingIdentifier(parser, context, kind, t, skipEvalArgCheck) {
2205
2210
  parser.report(100);
2206
2211
  }
2207
2212
  if (context & (2048 | 2) && t === 209006) {
2208
- parser.report(110);
2213
+ parser.report(112);
2209
2214
  }
2210
2215
  if (context & (1024 | 1) && t === 241771) {
2211
2216
  parser.report(97, 'yield');
@@ -2214,10 +2219,10 @@ function validateBindingIdentifier(parser, context, kind, t, skipEvalArgCheck) {
2214
2219
  function validateFunctionName(parser, context, t) {
2215
2220
  if (context & 1) {
2216
2221
  if ((t & 36864) === 36864) {
2217
- parser.report(118);
2222
+ parser.report(120);
2218
2223
  }
2219
2224
  if ((t & 537079808) === 537079808) {
2220
- parser.report(119);
2225
+ parser.report(121);
2221
2226
  }
2222
2227
  if (t === -2147483526) {
2223
2228
  parser.report(95);
@@ -2230,7 +2235,7 @@ function validateFunctionName(parser, context, t) {
2230
2235
  parser.report(102);
2231
2236
  }
2232
2237
  if (context & (2048 | 2) && t === 209006) {
2233
- parser.report(110);
2238
+ parser.report(112);
2234
2239
  }
2235
2240
  if (context & (1024 | 1) && t === 241771) {
2236
2241
  parser.report(97, 'yield');
@@ -2239,7 +2244,7 @@ function validateFunctionName(parser, context, t) {
2239
2244
  function isStrictReservedWord(parser, context, t) {
2240
2245
  if (t === 209006) {
2241
2246
  if (context & (2048 | 2))
2242
- parser.report(110);
2247
+ parser.report(112);
2243
2248
  parser.destructible |= 128;
2244
2249
  }
2245
2250
  if (t === 241771 && context & 1024)
@@ -2255,7 +2260,7 @@ function isValidLabel(parser, labels, name, isIterationStatement) {
2255
2260
  while (labels) {
2256
2261
  if (labels['$' + name]) {
2257
2262
  if (isIterationStatement)
2258
- parser.report(137);
2263
+ parser.report(139);
2259
2264
  return 1;
2260
2265
  }
2261
2266
  if (isIterationStatement && labels.loop)
@@ -2268,7 +2273,7 @@ function validateAndDeclareLabel(parser, labels, name) {
2268
2273
  let set = labels;
2269
2274
  while (set) {
2270
2275
  if (set['$' + name])
2271
- parser.report(136, name);
2276
+ parser.report(138, name);
2272
2277
  set = set['$'];
2273
2278
  }
2274
2279
  labels['$' + name] = 1;
@@ -2296,14 +2301,14 @@ function isValidIdentifier(context, t) {
2296
2301
  function classifyIdentifier(parser, context, t) {
2297
2302
  if ((t & 537079808) === 537079808) {
2298
2303
  if (context & 1)
2299
- parser.report(119);
2304
+ parser.report(121);
2300
2305
  parser.flags |= 512;
2301
2306
  }
2302
2307
  if (!isValidIdentifier(context, t))
2303
2308
  parser.report(0);
2304
2309
  }
2305
2310
 
2306
- const entities = {
2311
+ const entities = new Map(Object.entries({
2307
2312
  AElig: '\u00C6',
2308
2313
  AMP: '\u0026',
2309
2314
  Aacute: '\u00C1',
@@ -4429,8 +4434,8 @@ const entities = {
4429
4434
  zscr: '\uD835\uDCCF',
4430
4435
  zwj: '\u200D',
4431
4436
  zwnj: '\u200C',
4432
- };
4433
- const decodeMap = {
4437
+ }));
4438
+ const decodeMap = new Map(Object.entries({
4434
4439
  '0': 65533,
4435
4440
  '128': 8364,
4436
4441
  '130': 8218,
@@ -4459,7 +4464,7 @@ const decodeMap = {
4459
4464
  '156': 339,
4460
4465
  '158': 382,
4461
4466
  '159': 376,
4462
- };
4467
+ }).map(([key, value]) => [Number(key), value]));
4463
4468
  function decodeHTMLStrict(text) {
4464
4469
  return text.replaceAll(/&(?:[a-zA-Z]+|#[xX][\da-fA-F]+|#\d+);/g, (key) => {
4465
4470
  if (key.charAt(1) === '#') {
@@ -4467,14 +4472,14 @@ function decodeHTMLStrict(text) {
4467
4472
  const codePoint = secondChar === 'X' || secondChar === 'x' ? parseInt(key.slice(3), 16) : parseInt(key.slice(2), 10);
4468
4473
  return decodeCodePoint(codePoint);
4469
4474
  }
4470
- return getOwnProperty(entities, key.slice(1, -1)) ?? key;
4475
+ return entities.get(key.slice(1, -1)) ?? key;
4471
4476
  });
4472
4477
  }
4473
4478
  function decodeCodePoint(codePoint) {
4474
4479
  if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
4475
4480
  return '\uFFFD';
4476
4481
  }
4477
- return String.fromCodePoint(getOwnProperty(decodeMap, codePoint) ?? codePoint);
4482
+ return String.fromCodePoint(decodeMap.get(codePoint) ?? codePoint);
4478
4483
  }
4479
4484
 
4480
4485
  function scanJSXAttributeValue(parser, context) {
@@ -4559,6 +4564,8 @@ function rescanJSXIdentifier(parser) {
4559
4564
  return parser.getToken();
4560
4565
  }
4561
4566
 
4567
+ const nextFeatures = 1 | 2 | 4;
4568
+
4562
4569
  function normalizeRanges(ranges) {
4563
4570
  if (!ranges)
4564
4571
  return undefined;
@@ -4571,17 +4578,27 @@ function normalizeRanges(ranges) {
4571
4578
  };
4572
4579
  }
4573
4580
  function normalizeOptions(rawOptions) {
4574
- const options = {
4581
+ let { features, next, ranges, module, sourceType, globalReturn, ...restOptions } = {
4575
4582
  validateRegex: true,
4583
+ features: 0,
4576
4584
  ...rawOptions,
4577
- ranges: normalizeRanges(rawOptions.ranges),
4578
4585
  };
4579
- if (options.module && !options.sourceType) {
4580
- options.sourceType = 'module';
4586
+ if (next) {
4587
+ features |= nextFeatures;
4588
+ }
4589
+ ranges = normalizeRanges(ranges);
4590
+ if (module && !sourceType) {
4591
+ sourceType = 'module';
4581
4592
  }
4582
- if (options.globalReturn && (!options.sourceType || options.sourceType === 'script')) {
4583
- options.sourceType = 'commonjs';
4593
+ if (globalReturn && (!sourceType || sourceType === 'script')) {
4594
+ sourceType = 'commonjs';
4584
4595
  }
4596
+ const options = {
4597
+ ...restOptions,
4598
+ ranges,
4599
+ features,
4600
+ sourceType,
4601
+ };
4585
4602
  return options;
4586
4603
  }
4587
4604
 
@@ -4602,7 +4619,7 @@ class PrivateScope {
4602
4619
  const value = privateIdentifiers.get(name);
4603
4620
  if (this.hasPrivateIdentifier(name) &&
4604
4621
  ((value & 32) !== (focusKind & 32) || value & focusKind & 768)) {
4605
- this.parser.report(146, name);
4622
+ this.parser.report(148, name);
4606
4623
  }
4607
4624
  privateIdentifiers.set(name, this.hasPrivateIdentifier(name) ? value | focusKind : focusKind);
4608
4625
  }
@@ -4663,17 +4680,17 @@ class Scope {
4663
4680
  ((kind & 128 && value & 68) ||
4664
4681
  (value & 128 && kind & 68))) ;
4665
4682
  else {
4666
- parser.report(145, name);
4683
+ parser.report(147, name);
4667
4684
  }
4668
4685
  }
4669
4686
  if (currentScope === this) {
4670
4687
  if (value && value & 1 && kind & 1) {
4671
- currentScope.recordScopeError(145, name);
4688
+ currentScope.recordScopeError(147, name);
4672
4689
  }
4673
4690
  }
4674
4691
  if (value &&
4675
4692
  (value & 256 || (value & 512 && !parser.options.webcompat))) {
4676
- parser.report(145, name);
4693
+ parser.report(147, name);
4677
4694
  }
4678
4695
  currentScope.variableBindings.set(name, kind);
4679
4696
  currentScope = currentScope.parent;
@@ -4687,7 +4704,7 @@ class Scope {
4687
4704
  const value = this.variableBindings.get(name);
4688
4705
  if (value && (value & 2) === 0) {
4689
4706
  if (kind & 1) {
4690
- this.recordScopeError(145, name);
4707
+ this.recordScopeError(147, name);
4691
4708
  }
4692
4709
  else if (parser.options.webcompat &&
4693
4710
  (context & 1) === 0 &&
@@ -4695,22 +4712,22 @@ class Scope {
4695
4712
  value === 64 &&
4696
4713
  kind === 64) ;
4697
4714
  else {
4698
- parser.report(145, name);
4715
+ parser.report(147, name);
4699
4716
  }
4700
4717
  }
4701
4718
  if (this.type & 64 &&
4702
4719
  this.parent?.hasVariable(name) &&
4703
4720
  (this.parent.variableBindings.get(name) & 2) === 0) {
4704
- parser.report(145, name);
4721
+ parser.report(147, name);
4705
4722
  }
4706
4723
  if (this.type & 512 && value && (value & 2) === 0) {
4707
4724
  if (kind & 1) {
4708
- this.recordScopeError(145, name);
4725
+ this.recordScopeError(147, name);
4709
4726
  }
4710
4727
  }
4711
4728
  if (this.type & 32) {
4712
4729
  if (this.parent.variableBindings.get(name) & 768)
4713
- parser.report(159, name);
4730
+ parser.report(161, name);
4714
4731
  }
4715
4732
  this.variableBindings.set(name, kind);
4716
4733
  }
@@ -4742,6 +4759,7 @@ class Parser {
4742
4759
  options;
4743
4760
  token = 1048576;
4744
4761
  flags = 0;
4762
+ features = 0;
4745
4763
  index = 0;
4746
4764
  line = 1;
4747
4765
  column = 0;
@@ -4767,6 +4785,7 @@ class Parser {
4767
4785
  this.end = source.length;
4768
4786
  this.currentChar = source.charCodeAt(0);
4769
4787
  this.options = normalizeOptions(rawOptions);
4788
+ this.features = this.options.features;
4770
4789
  if (Array.isArray(this.options.onComment)) {
4771
4790
  this.options.onComment = pushComment(this.options.onComment, this.options);
4772
4791
  }
@@ -4847,7 +4866,7 @@ class Parser {
4847
4866
  declareUnboundVariable(name) {
4848
4867
  const { exportedNames } = this;
4849
4868
  if (exportedNames.has(name)) {
4850
- this.report(147, name);
4869
+ this.report(149, name);
4851
4870
  }
4852
4871
  exportedNames.add(name);
4853
4872
  }
@@ -4870,29 +4889,10 @@ class Parser {
4870
4889
  return undefined;
4871
4890
  }
4872
4891
  cloneIdentifier(original) {
4873
- return this.cloneLocationInformation({ ...original }, original);
4892
+ return structuredClone(original);
4874
4893
  }
4875
4894
  cloneStringLiteral(original) {
4876
- return this.cloneLocationInformation({ ...original }, original);
4877
- }
4878
- cloneLocationInformation(node, original) {
4879
- const { ranges } = this.options;
4880
- if (ranges) {
4881
- if (ranges.start)
4882
- node.start = original.start;
4883
- if (ranges.end)
4884
- node.end = original.end;
4885
- if (ranges.range)
4886
- node.range = [...original.range];
4887
- }
4888
- if (this.options.loc) {
4889
- node.loc = {
4890
- ...original.loc,
4891
- start: { ...original.loc.start },
4892
- end: { ...original.loc.end },
4893
- };
4894
- }
4895
- return node;
4895
+ return structuredClone(original);
4896
4896
  }
4897
4897
  }
4898
4898
  function pushComment(comments, options) {
@@ -4955,7 +4955,7 @@ function parseSource(source, rawOptions = {}, context = 0) {
4955
4955
  if (scope) {
4956
4956
  for (const name of parser.exportedBindings) {
4957
4957
  if (!scope.hasVariable(name))
4958
- parser.report(148, name);
4958
+ parser.report(150, name);
4959
4959
  }
4960
4960
  }
4961
4961
  }
@@ -5017,22 +5017,28 @@ function parseModuleItem(parser, context, scope) {
5017
5017
  moduleItem = parseExportDeclaration(parser, context, scope);
5018
5018
  break;
5019
5019
  case 86106:
5020
+ if (parser.leadingDecorators.decorators.length) {
5021
+ parser.report(172);
5022
+ }
5020
5023
  moduleItem = parseImportDeclaration(parser, context, scope);
5021
5024
  break;
5022
5025
  default:
5023
5026
  moduleItem = parseStatementListItem(parser, context, scope, undefined, 4, {});
5024
5027
  }
5025
- if (parser.leadingDecorators?.decorators.length) {
5026
- parser.report(170);
5027
- }
5028
5028
  return moduleItem;
5029
5029
  }
5030
5030
  function parseStatementListItem(parser, context, scope, privateScope, origin, labels) {
5031
5031
  const start = parser.tokenStart;
5032
+ if (parser.leadingDecorators.decorators.length && parser.getToken() !== 86094) {
5033
+ parser.report(172);
5034
+ }
5032
5035
  switch (parser.getToken()) {
5033
5036
  case 86104:
5034
5037
  return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 0, start);
5035
5038
  case 133:
5039
+ if (!(parser.features & 1)) {
5040
+ parser.report(30, '@');
5041
+ }
5036
5042
  case 86094:
5037
5043
  return parseClassDeclaration(parser, context, scope, privateScope, 0);
5038
5044
  case 86090:
@@ -5100,9 +5106,9 @@ function parseStatement(parser, context, scope, privateScope, origin, labels, al
5100
5106
  case 209005:
5101
5107
  return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 0);
5102
5108
  case 20557:
5103
- parser.report(162);
5109
+ parser.report(164);
5104
5110
  case 20566:
5105
- parser.report(163);
5111
+ parser.report(165);
5106
5112
  case 86104:
5107
5113
  parser.report(context & 1
5108
5114
  ? 76
@@ -5203,7 +5209,7 @@ function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, priva
5203
5209
  if (!asyncNewLine) {
5204
5210
  if (parser.getToken() === 86104) {
5205
5211
  if (!allowFuncDecl)
5206
- parser.report(123);
5212
+ parser.report(125);
5207
5213
  return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 1, start);
5208
5214
  }
5209
5215
  if (isValidIdentifier(context, parser.getToken())) {
@@ -5378,7 +5384,7 @@ function parseContinueStatement(parser, context, labels) {
5378
5384
  const { tokenValue } = parser;
5379
5385
  label = parseIdentifier(parser, context | 32);
5380
5386
  if (!isValidLabel(parser, labels, tokenValue, 1))
5381
- parser.report(138, tokenValue);
5387
+ parser.report(140, tokenValue);
5382
5388
  }
5383
5389
  matchOrInsertSemicolon(parser, context | 32);
5384
5390
  return parser.finishNode({
@@ -5394,7 +5400,7 @@ function parseBreakStatement(parser, context, labels) {
5394
5400
  const { tokenValue } = parser;
5395
5401
  label = parseIdentifier(parser, context | 32);
5396
5402
  if (!isValidLabel(parser, labels, tokenValue, 0))
5397
- parser.report(138, tokenValue);
5403
+ parser.report(140, tokenValue);
5398
5404
  }
5399
5405
  else if ((context & (4 | 128)) === 0) {
5400
5406
  parser.report(69);
@@ -5591,7 +5597,7 @@ function parseUsingDeclarationOrExpressionStatement(parser, context, scope, priv
5591
5597
  function parseAwaitUsingDeclarationOrExpressionStatement(parser, context, scope, privateScope, origin, labels) {
5592
5598
  const start = parser.tokenStart;
5593
5599
  if (context & 524288)
5594
- parser.report(177);
5600
+ parser.report(179);
5595
5601
  nextToken(parser, context | 32);
5596
5602
  let argument;
5597
5603
  if ((parser.flags & 1) === 0 && parser.getToken() === 209013) {
@@ -5648,7 +5654,7 @@ function parseVariableDeclarationList(parser, context, scope, privateScope, kind
5648
5654
  if (resourceNames) {
5649
5655
  const { name } = declaration.id;
5650
5656
  if (resourceNames.has(name))
5651
- parser.report(145, name);
5657
+ parser.report(147, name);
5652
5658
  resourceNames.add(name);
5653
5659
  }
5654
5660
  list.push(declaration);
@@ -5727,7 +5733,7 @@ function parseForStatement(parser, context, scope, privateScope, labels) {
5727
5733
  parser.assignable = 1;
5728
5734
  init = parseMemberOrUpdateExpression(parser, context, privateScope, init, 0, 0, tokenStart);
5729
5735
  if (parser.getToken() === 471156)
5730
- parser.report(115);
5736
+ parser.report(117);
5731
5737
  }
5732
5738
  }
5733
5739
  else if (token === 209013) {
@@ -5779,7 +5785,7 @@ function parseForStatement(parser, context, scope, privateScope, labels) {
5779
5785
  if (resourceNames) {
5780
5786
  const { name } = declaration.id;
5781
5787
  if (resourceNames.has(name))
5782
- parser.report(145, name);
5788
+ parser.report(147, name);
5783
5789
  resourceNames.add(name);
5784
5790
  }
5785
5791
  declarations.push(declaration);
@@ -5824,7 +5830,7 @@ function parseForStatement(parser, context, scope, privateScope, labels) {
5824
5830
  else if (token === 209006 &&
5825
5831
  (context & 2048 || (context & 2 && context & 8))) {
5826
5832
  if (context & 524288)
5827
- parser.report(177);
5833
+ parser.report(179);
5828
5834
  nextToken(parser, context | 32);
5829
5835
  let awaitArgument;
5830
5836
  if ((parser.flags & 1) === 0 && parser.getToken() === 209013) {
@@ -5942,9 +5948,9 @@ function parseForStatement(parser, context, scope, privateScope, labels) {
5942
5948
  }
5943
5949
  function parseRestrictedIdentifier(parser, context, scope) {
5944
5950
  if (!isValidIdentifier(context, parser.getToken()))
5945
- parser.report(118);
5951
+ parser.report(120);
5946
5952
  if ((parser.getToken() & 537079808) === 537079808)
5947
- parser.report(119);
5953
+ parser.report(121);
5948
5954
  scope?.addBlockName(context, parser.tokenValue, 8, 0);
5949
5955
  return parseIdentifier(parser, context);
5950
5956
  }
@@ -5952,6 +5958,8 @@ function parseImportDeclaration(parser, context, scope) {
5952
5958
  const start = parser.tokenStart;
5953
5959
  nextToken(parser, context);
5954
5960
  let source;
5961
+ let sourceParsed = false;
5962
+ let phase = null;
5955
5963
  const { tokenStart } = parser;
5956
5964
  let specifiers = [];
5957
5965
  if (parser.getToken() === 134283267) {
@@ -5959,14 +5967,93 @@ function parseImportDeclaration(parser, context, scope) {
5959
5967
  }
5960
5968
  else {
5961
5969
  if (parser.getToken() & 143360) {
5962
- const local = parseRestrictedIdentifier(parser, context, scope);
5963
- specifiers = [
5964
- parser.finishNode({
5965
- type: 'ImportDefaultSpecifier',
5966
- local,
5967
- }, tokenStart),
5968
- ];
5969
- if (consumeOpt(parser, context, 18)) {
5970
+ const token = parser.getToken();
5971
+ const { tokenValue } = parser;
5972
+ const isPhaseDefer = parser.features & 2 && (token & -2147483648) === 0 && tokenValue == 'defer';
5973
+ const isPhaseSource = parser.features & 4 && (token & -2147483648) === 0 && tokenValue == 'source';
5974
+ if (isPhaseDefer || isPhaseSource) {
5975
+ const phaseOrLocal = parseIdentifier(parser, context);
5976
+ if (tokenValue === 'defer') {
5977
+ if (parser.getToken() === 8391476) {
5978
+ phase = 'defer';
5979
+ specifiers = [parseImportNamespaceSpecifier(parser, context, scope)];
5980
+ }
5981
+ else if (parser.getToken() === 209011 || parser.getToken() === 18) {
5982
+ scope?.addBlockName(context, tokenValue, 8, 0);
5983
+ specifiers = [
5984
+ parser.finishNode({
5985
+ type: 'ImportDefaultSpecifier',
5986
+ local: phaseOrLocal,
5987
+ }, tokenStart),
5988
+ ];
5989
+ }
5990
+ else {
5991
+ parser.report(108);
5992
+ }
5993
+ }
5994
+ else if (parser.getToken() === 209011) {
5995
+ const fromToken = parser.getToken();
5996
+ const fromStart = parser.tokenStart;
5997
+ const fromLocal = parseIdentifier(parser, context);
5998
+ if (parser.getToken() === 209011) {
5999
+ validateBindingIdentifier(parser, context, 16, fromToken, 0);
6000
+ scope?.addBlockName(context, fromLocal.name, 8, 0);
6001
+ phase = 'source';
6002
+ specifiers = [
6003
+ parser.finishNode({
6004
+ type: 'ImportDefaultSpecifier',
6005
+ local: fromLocal,
6006
+ }, fromStart),
6007
+ ];
6008
+ }
6009
+ else {
6010
+ scope?.addBlockName(context, tokenValue, 8, 0);
6011
+ specifiers = [
6012
+ parser.finishNode({
6013
+ type: 'ImportDefaultSpecifier',
6014
+ local: phaseOrLocal,
6015
+ }, tokenStart),
6016
+ ];
6017
+ if (parser.getToken() !== 134283267)
6018
+ parser.report(105, 'Import');
6019
+ source = parseLiteral(parser, context);
6020
+ sourceParsed = true;
6021
+ }
6022
+ }
6023
+ else if (parser.getToken() & 143360) {
6024
+ phase = 'source';
6025
+ const localStart = parser.tokenStart;
6026
+ const local = parseRestrictedIdentifier(parser, context, scope);
6027
+ specifiers = [
6028
+ parser.finishNode({
6029
+ type: 'ImportDefaultSpecifier',
6030
+ local,
6031
+ }, localStart),
6032
+ ];
6033
+ }
6034
+ else if (parser.getToken() === 18) {
6035
+ scope?.addBlockName(context, tokenValue, 8, 0);
6036
+ specifiers = [
6037
+ parser.finishNode({
6038
+ type: 'ImportDefaultSpecifier',
6039
+ local: phaseOrLocal,
6040
+ }, tokenStart),
6041
+ ];
6042
+ }
6043
+ else {
6044
+ parser.report(109);
6045
+ }
6046
+ }
6047
+ else {
6048
+ const local = parseRestrictedIdentifier(parser, context, scope);
6049
+ specifiers = [
6050
+ parser.finishNode({
6051
+ type: 'ImportDefaultSpecifier',
6052
+ local,
6053
+ }, tokenStart),
6054
+ ];
6055
+ }
6056
+ if (phase === null && !sourceParsed && consumeOpt(parser, context, 18)) {
5970
6057
  switch (parser.getToken()) {
5971
6058
  case 8391476:
5972
6059
  specifiers.push(parseImportNamespaceSpecifier(parser, context, scope));
@@ -5995,7 +6082,8 @@ function parseImportDeclaration(parser, context, scope) {
5995
6082
  parser.report(30, KeywordDescTable[parser.getToken() & 255]);
5996
6083
  }
5997
6084
  }
5998
- source = parseModuleSpecifier(parser, context);
6085
+ if (!sourceParsed)
6086
+ source = parseModuleSpecifier(parser, context);
5999
6087
  }
6000
6088
  const attributes = parseImportAttributes(parser, context);
6001
6089
  const node = {
@@ -6003,6 +6091,7 @@ function parseImportDeclaration(parser, context, scope) {
6003
6091
  specifiers,
6004
6092
  source,
6005
6093
  attributes,
6094
+ ...(parser.features & 2 || parser.features & 4 ? { phase } : null),
6006
6095
  };
6007
6096
  matchOrInsertSemicolon(parser, context | 32);
6008
6097
  return parser.finishNode(node, start);
@@ -6085,17 +6174,24 @@ function parseImportCallDeclaration(parser, context, privateScope, start) {
6085
6174
  function parseExportDeclaration(parser, context, scope) {
6086
6175
  const start = parser.leadingDecorators.decorators.length ? parser.leadingDecorators.start : parser.tokenStart;
6087
6176
  nextToken(parser, context | 32);
6177
+ const isDefaultExport = consumeOpt(parser, context | 32, 20561);
6178
+ if (parser.leadingDecorators.decorators.length && parser.getToken() !== 86094) {
6179
+ parser.report(172);
6180
+ }
6088
6181
  const specifiers = [];
6089
6182
  let declaration = null;
6090
6183
  let source = null;
6091
6184
  let attributes = [];
6092
- if (consumeOpt(parser, context | 32, 20561)) {
6185
+ if (isDefaultExport) {
6093
6186
  switch (parser.getToken()) {
6094
6187
  case 86104: {
6095
6188
  declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 1, 0, parser.tokenStart);
6096
6189
  break;
6097
6190
  }
6098
6191
  case 133:
6192
+ if (!(parser.features & 1)) {
6193
+ parser.report(30, '@');
6194
+ }
6099
6195
  case 86094:
6100
6196
  declaration = parseClassDeclaration(parser, context, scope, undefined, 1);
6101
6197
  break;
@@ -6208,7 +6304,7 @@ function parseExportDeclaration(parser, context, scope) {
6208
6304
  }
6209
6305
  else {
6210
6306
  if (hasLiteralLocal) {
6211
- parser.report(172);
6307
+ parser.report(174);
6212
6308
  }
6213
6309
  if (scope) {
6214
6310
  tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n));
@@ -6219,6 +6315,9 @@ function parseExportDeclaration(parser, context, scope) {
6219
6315
  break;
6220
6316
  }
6221
6317
  case 133:
6318
+ if (!(parser.features & 1)) {
6319
+ parser.report(30, '@');
6320
+ }
6222
6321
  case 86094:
6223
6322
  declaration = parseClassDeclaration(parser, context, scope, undefined, 2);
6224
6323
  break;
@@ -6351,7 +6450,7 @@ function parseBinaryExpression(parser, context, privateScope, inGroup, start, mi
6351
6450
  t = parser.getToken();
6352
6451
  precedence = t & 3840;
6353
6452
  if ((t & 524288 && operator & 268435456) || (operator & 524288 && t & 268435456)) {
6354
- parser.report(165);
6453
+ parser.report(167);
6355
6454
  }
6356
6455
  if (precedence + ((t === 8391735) << 8) - ((bit === t) << 12) <= minPrecedence)
6357
6456
  break;
@@ -6378,10 +6477,10 @@ function parseUnaryExpression(parser, context, privateScope, isLHS, inGroup) {
6378
6477
  parser.report(33);
6379
6478
  if (context & 1 && unaryOperator === 16863276) {
6380
6479
  if (arg.type === 'Identifier') {
6381
- parser.report(121);
6480
+ parser.report(123);
6382
6481
  }
6383
6482
  else if (isPropertyWithPrivateFieldKey(arg)) {
6384
- parser.report(127);
6483
+ parser.report(129);
6385
6484
  }
6386
6485
  }
6387
6486
  parser.assignable = 2;
@@ -6434,7 +6533,7 @@ function parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup
6434
6533
  if (!canAssign)
6435
6534
  parser.report(26);
6436
6535
  if (parser.getToken() === 22)
6437
- parser.report(124);
6536
+ parser.report(126);
6438
6537
  let argument = null;
6439
6538
  let delegate = false;
6440
6539
  if ((parser.flags & 1) === 0) {
@@ -6461,17 +6560,17 @@ function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew,
6461
6560
  if (inGroup)
6462
6561
  parser.destructible |= 128;
6463
6562
  if (context & 524288)
6464
- parser.report(177);
6563
+ parser.report(179);
6465
6564
  const possibleIdentifierOrArrowFunc = parseIdentifierOrArrow(parser, context, privateScope);
6466
6565
  const isIdentifier = possibleIdentifierOrArrowFunc.type === 'ArrowFunctionExpression' ||
6467
6566
  (parser.getToken() & 65536) === 0;
6468
6567
  if (isIdentifier) {
6469
6568
  if (context & 2048)
6470
- throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 176);
6569
+ throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 178);
6471
6570
  if (context & 2)
6472
- throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110);
6571
+ throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 112);
6473
6572
  if (context & 8192 && context & 2048)
6474
- throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110);
6573
+ throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 112);
6475
6574
  return possibleIdentifierOrArrowFunc;
6476
6575
  }
6477
6576
  if (context & 8192) {
@@ -6495,6 +6594,7 @@ function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew,
6495
6594
  }
6496
6595
  function parseFunctionBody(parser, context, scope, privateScope, origin, funcNameToken, functionScope) {
6497
6596
  const { tokenStart } = parser;
6597
+ parser.flags &= -4161;
6498
6598
  consume(parser, context | 32, 2162700);
6499
6599
  const body = [];
6500
6600
  if (parser.getToken() !== 1074790415) {
@@ -6520,19 +6620,19 @@ function parseFunctionBody(parser, context, scope, privateScope, origin, funcNam
6520
6620
  if (context & 1) {
6521
6621
  if (funcNameToken) {
6522
6622
  if ((funcNameToken & 537079808) === 537079808) {
6523
- parser.report(119);
6623
+ parser.report(121);
6524
6624
  }
6525
6625
  if ((funcNameToken & 36864) === 36864) {
6526
6626
  parser.report(40);
6527
6627
  }
6528
6628
  }
6529
6629
  if (parser.flags & 512)
6530
- parser.report(119);
6630
+ parser.report(121);
6531
6631
  if (parser.flags & 256) {
6532
6632
  if (parser.strictReservedRange) {
6533
- throw new ParseError(parser.strictReservedRange[0], parser.strictReservedRange[1], 118);
6633
+ throw new ParseError(parser.strictReservedRange[0], parser.strictReservedRange[1], 120);
6534
6634
  }
6535
- parser.report(118);
6635
+ parser.report(120);
6536
6636
  }
6537
6637
  }
6538
6638
  }
@@ -6557,7 +6657,7 @@ function parseSuperExpression(parser, context) {
6557
6657
  nextToken(parser, context);
6558
6658
  switch (parser.getToken()) {
6559
6659
  case 67108991:
6560
- parser.report(167);
6660
+ parser.report(169);
6561
6661
  case 67174411: {
6562
6662
  if ((context & 512) === 0)
6563
6663
  parser.report(28);
@@ -6604,7 +6704,7 @@ function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGr
6604
6704
  case 67108877: {
6605
6705
  nextToken(parser, (context | 262144 | 8) ^ 8);
6606
6706
  if (context & 16 && parser.getToken() === 131 && parser.tokenValue === 'super') {
6607
- parser.report(173);
6707
+ parser.report(175);
6608
6708
  }
6609
6709
  parser.assignable =
6610
6710
  (parser.flags & 2048) === 2048
@@ -6684,7 +6784,7 @@ function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGr
6684
6784
  }
6685
6785
  default:
6686
6786
  if ((parser.flags & 2048) === 2048) {
6687
- parser.report(166);
6787
+ parser.report(168);
6688
6788
  }
6689
6789
  parser.assignable = 2;
6690
6790
  expr = parser.finishNode({
@@ -6765,7 +6865,7 @@ function parsePropertyOrPrivatePropertyName(parser, context, privateScope) {
6765
6865
  parser.getToken() !== -2147483527 &&
6766
6866
  parser.getToken() !== -2147483526 &&
6767
6867
  parser.getToken() !== 131) {
6768
- parser.report(160);
6868
+ parser.report(162);
6769
6869
  }
6770
6870
  return parser.getToken() === 131
6771
6871
  ? parsePrivateIdentifier(parser, context, privateScope, 0)
@@ -6816,10 +6916,10 @@ function parsePrimaryExpression(parser, context, privateScope, kind, inNew, canA
6816
6916
  !(context & 32768) &&
6817
6917
  !(context & 8192) &&
6818
6918
  parser.tokenValue === 'arguments')
6819
- parser.report(130);
6919
+ parser.report(132);
6820
6920
  if ((token & 255) === (241737 & 255)) {
6821
6921
  if (context & 1)
6822
- parser.report(113);
6922
+ parser.report(115);
6823
6923
  if (kind & (8 | 16))
6824
6924
  parser.report(100);
6825
6925
  }
@@ -6861,6 +6961,9 @@ function parsePrimaryExpression(parser, context, privateScope, kind, inNew, canA
6861
6961
  case 65540:
6862
6962
  return parseRegExpLiteral(parser, context);
6863
6963
  case 133:
6964
+ if (!(parser.features & 1)) {
6965
+ parser.report(30, '@');
6966
+ }
6864
6967
  case 86094:
6865
6968
  return parseClassExpression(parser, context, privateScope, inGroup, start);
6866
6969
  case 86109:
@@ -6889,24 +6992,37 @@ function parsePrimaryExpression(parser, context, privateScope, kind, inNew, canA
6889
6992
  function parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start) {
6890
6993
  let expr = parseIdentifier(parser, context);
6891
6994
  if (parser.getToken() === 67108877) {
6892
- return parseImportMetaExpression(parser, context, expr, start);
6995
+ return parseImportMetaExpression(parser, context, expr, start, privateScope, inGroup, inNew);
6893
6996
  }
6894
6997
  if (inNew)
6895
- parser.report(142);
6998
+ parser.report(144);
6896
6999
  expr = parseImportExpression(parser, context, privateScope, inGroup, start);
6897
7000
  parser.assignable = 2;
6898
7001
  return parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start);
6899
7002
  }
6900
- function parseImportMetaExpression(parser, context, meta, start) {
6901
- if ((context & 2) === 0)
6902
- parser.report(169);
7003
+ function parseImportMetaExpression(parser, context, meta, start, privateScope, inGroup = 0, inNew = 0) {
7004
+ const propertyStart = parser.tokenStart;
7005
+ const propertyEnd = parser.currentLocation;
6903
7006
  nextToken(parser, context);
6904
7007
  const token = parser.getToken();
7008
+ const isPhaseDefer = parser.features & 2 && (token & -2147483648) === 0 && parser.tokenValue === 'defer';
7009
+ const isPhaseSource = parser.features & 4 && (token & -2147483648) === 0 && parser.tokenValue === 'source';
7010
+ if (isPhaseDefer || isPhaseSource) {
7011
+ if (inNew)
7012
+ parser.report(144);
7013
+ nextToken(parser, context);
7014
+ const expression = parseImportExpression(parser, context, privateScope, inGroup, start, parser.tokenValue);
7015
+ parser.assignable = 2;
7016
+ return expression;
7017
+ }
7018
+ if ((context & 2) === 0) {
7019
+ throw new ParseError(propertyStart, propertyEnd, 171);
7020
+ }
6905
7021
  if (token !== 209031 && parser.tokenValue !== 'meta') {
6906
- parser.report(174);
7022
+ parser.report(176);
6907
7023
  }
6908
7024
  else if (token & -2147483648) {
6909
- parser.report(175);
7025
+ parser.report(177);
6910
7026
  }
6911
7027
  parser.assignable = 2;
6912
7028
  return parser.finishNode({
@@ -6915,10 +7031,10 @@ function parseImportMetaExpression(parser, context, meta, start) {
6915
7031
  property: parseIdentifier(parser, context),
6916
7032
  }, start);
6917
7033
  }
6918
- function parseImportExpression(parser, context, privateScope, inGroup, start) {
7034
+ function parseImportExpression(parser, context, privateScope, inGroup, start, phase = null) {
6919
7035
  consume(parser, context | 32, 67174411);
6920
7036
  if (parser.getToken() === 14)
6921
- parser.report(143);
7037
+ parser.report(145);
6922
7038
  const source = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart);
6923
7039
  let options = null;
6924
7040
  if (parser.getToken() === 18) {
@@ -6933,6 +7049,7 @@ function parseImportExpression(parser, context, privateScope, inGroup, start) {
6933
7049
  type: 'ImportExpression',
6934
7050
  source,
6935
7051
  options,
7052
+ ...(parser.features & 2 || parser.features & 4 ? { phase } : null),
6936
7053
  };
6937
7054
  consume(parser, context, 16);
6938
7055
  return parser.finishNode(node, start);
@@ -6950,7 +7067,7 @@ function parseImportAttributes(parser, context) {
6950
7067
  const value = parseStringLiteral(parser, context);
6951
7068
  const keyContent = key.type === 'Literal' ? key.value : key.name;
6952
7069
  if (keysContent.has(keyContent)) {
6953
- parser.report(145, keyContent);
7070
+ parser.report(147, keyContent);
6954
7071
  }
6955
7072
  keysContent.add(keyContent);
6956
7073
  attributes.push(parser.finishNode({
@@ -6988,7 +7105,7 @@ function parseModuleExportName(parser, context) {
6988
7105
  if (parser.getToken() === 134283267) {
6989
7106
  const value = parser.tokenValue;
6990
7107
  if (!value.isWellFormed()) {
6991
- parser.report(171);
7108
+ parser.report(173);
6992
7109
  }
6993
7110
  return parseLiteral(parser, context);
6994
7111
  }
@@ -7549,7 +7666,7 @@ function parseSpreadOrRestElement(parser, context, scope, privateScope, closingT
7549
7666
  }
7550
7667
  parser.destructible = destructible;
7551
7668
  if (parser.getToken() !== closingToken && parser.getToken() !== 18)
7552
- parser.report(161);
7669
+ parser.report(163);
7553
7670
  return parser.finishNode({
7554
7671
  type: isPattern ? 'RestElement' : 'SpreadElement',
7555
7672
  argument: argument,
@@ -7808,7 +7925,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipI
7808
7925
  parser.report(95);
7809
7926
  if (token === 209005) {
7810
7927
  if (parser.flags & 1)
7811
- parser.report(132);
7928
+ parser.report(134);
7812
7929
  state |= 16 | 1;
7813
7930
  }
7814
7931
  else if (token === 209008) {
@@ -7872,7 +7989,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipI
7872
7989
  value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);
7873
7990
  }
7874
7991
  else {
7875
- parser.report(133);
7992
+ parser.report(135);
7876
7993
  }
7877
7994
  }
7878
7995
  else if ((parser.getToken() & 134217728) === 134217728) {
@@ -7976,7 +8093,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipI
7976
8093
  destructible = 16;
7977
8094
  }
7978
8095
  else {
7979
- parser.report(134);
8096
+ parser.report(136);
7980
8097
  }
7981
8098
  }
7982
8099
  else if (parser.getToken() === 69271571) {
@@ -8123,7 +8240,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipI
8123
8240
  value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);
8124
8241
  }
8125
8242
  else {
8126
- parser.report(126);
8243
+ parser.report(128);
8127
8244
  }
8128
8245
  }
8129
8246
  else {
@@ -8301,7 +8418,7 @@ function parseParenthesizedExpression(parser, context, privateScope, canAssign,
8301
8418
  parser.assignable = 2;
8302
8419
  if (parser.getToken() !== 16 && parser.getToken() !== 18) {
8303
8420
  if (destructible & 8)
8304
- parser.report(122);
8421
+ parser.report(124);
8305
8422
  expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart);
8306
8423
  destructible |= 16;
8307
8424
  if (parser.getToken() !== 16 && parser.getToken() !== 18) {
@@ -8374,7 +8491,7 @@ function parseParenthesizedExpression(parser, context, privateScope, canAssign,
8374
8491
  }
8375
8492
  consume(parser, context, 16);
8376
8493
  if (destructible & 16 && destructible & 8)
8377
- parser.report(151);
8494
+ parser.report(153);
8378
8495
  destructible |=
8379
8496
  parser.destructible & 256
8380
8497
  ? 256
@@ -8399,7 +8516,7 @@ function parseParenthesizedExpression(parser, context, privateScope, canAssign,
8399
8516
  parser.report(63);
8400
8517
  }
8401
8518
  if (destructible & 8) {
8402
- parser.report(144);
8519
+ parser.report(146);
8403
8520
  }
8404
8521
  parser.destructible = ((parser.destructible | 256) ^ 256) | destructible;
8405
8522
  return parser.options.preserveParens
@@ -8470,17 +8587,17 @@ function parseArrowFunctionExpression(parser, context, scope, privateScope, para
8470
8587
  switch (parser.getToken()) {
8471
8588
  case 69271571:
8472
8589
  if ((parser.flags & 1) === 0) {
8473
- parser.report(116);
8590
+ parser.report(118);
8474
8591
  }
8475
8592
  parser.flags |= 8192;
8476
8593
  break;
8477
8594
  case 67108877:
8478
8595
  case 67174409:
8479
8596
  case 22:
8480
- parser.report(117);
8597
+ parser.report(119);
8481
8598
  case 67174411:
8482
8599
  if ((parser.flags & 1) === 0) {
8483
- parser.report(116);
8600
+ parser.report(118);
8484
8601
  }
8485
8602
  parser.flags |= 1024;
8486
8603
  break;
@@ -8488,7 +8605,7 @@ function parseArrowFunctionExpression(parser, context, scope, privateScope, para
8488
8605
  if ((parser.getToken() & 8388608) === 8388608 && (parser.flags & 1) === 0)
8489
8606
  parser.report(30, KeywordDescTable[parser.getToken() & 255]);
8490
8607
  if ((parser.getToken() & 33619968) === 33619968)
8491
- parser.report(125);
8608
+ parser.report(127);
8492
8609
  }
8493
8610
  parser.assignable = 2;
8494
8611
  return parser.finishNode({
@@ -8628,7 +8745,7 @@ function parseNewExpression(parser, context, privateScope, inGroup) {
8628
8745
  const expr = parsePrimaryExpression(parser, context, privateScope, 2, 1, 0, inGroup, 1, tokenStart);
8629
8746
  context = (context | 131072) ^ 131072;
8630
8747
  if (parser.getToken() === 67108991)
8631
- parser.report(168);
8748
+ parser.report(170);
8632
8749
  const callee = parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, tokenStart);
8633
8750
  parser.assignable = 2;
8634
8751
  return parser.finishNode({
@@ -8727,7 +8844,7 @@ function parseAsyncArrowOrCallExpression(parser, context, privateScope, callee,
8727
8844
  isNonSimpleParameterList = 1;
8728
8845
  if (parser.getToken() !== 16 && parser.getToken() !== 18) {
8729
8846
  if (destructible & 8)
8730
- parser.report(122);
8847
+ parser.report(124);
8731
8848
  expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart);
8732
8849
  destructible |= 16;
8733
8850
  if ((parser.getToken() & 8388608) === 8388608) {
@@ -8828,9 +8945,6 @@ function parseClassDeclaration(parser, context, scope, privateScope, flags) {
8828
8945
  let start;
8829
8946
  let decorators;
8830
8947
  if (parser.leadingDecorators.decorators.length) {
8831
- if (parser.getToken() === 133) {
8832
- parser.report(30, '@');
8833
- }
8834
8948
  start = parser.leadingDecorators.start;
8835
8949
  decorators = [...parser.leadingDecorators.decorators];
8836
8950
  parser.leadingDecorators.decorators.length = 0;
@@ -8840,16 +8954,16 @@ function parseClassDeclaration(parser, context, scope, privateScope, flags) {
8840
8954
  decorators = parseDecorators(parser, context, privateScope);
8841
8955
  }
8842
8956
  context = (context | 16384 | 1) ^ 16384;
8843
- nextToken(parser, context);
8957
+ consume(parser, context, 86094);
8844
8958
  let id = null;
8845
8959
  let superClass = null;
8846
8960
  const { tokenValue } = parser;
8847
8961
  if (parser.getToken() & 4096 && parser.getToken() !== 20565) {
8848
8962
  if (isStrictReservedWord(parser, context, parser.getToken())) {
8849
- parser.report(118);
8963
+ parser.report(120);
8850
8964
  }
8851
8965
  if ((parser.getToken() & 537079808) === 537079808) {
8852
- parser.report(119);
8966
+ parser.report(121);
8853
8967
  }
8854
8968
  if (scope) {
8855
8969
  scope.addBlockName(context, tokenValue, 32, 0);
@@ -8879,7 +8993,7 @@ function parseClassDeclaration(parser, context, scope, privateScope, flags) {
8879
8993
  id,
8880
8994
  superClass,
8881
8995
  body,
8882
- ...(parser.options.next ? { decorators } : null),
8996
+ ...(parser.features & 1 ? { decorators } : null),
8883
8997
  }, start);
8884
8998
  }
8885
8999
  function parseClassExpression(parser, context, privateScope, inGroup, start) {
@@ -8887,12 +9001,12 @@ function parseClassExpression(parser, context, privateScope, inGroup, start) {
8887
9001
  let superClass = null;
8888
9002
  const decorators = parseDecorators(parser, context, privateScope);
8889
9003
  context = (context | 1 | 16384) ^ 16384;
8890
- nextToken(parser, context);
9004
+ consume(parser, context, 86094);
8891
9005
  if (parser.getToken() & 4096 && parser.getToken() !== 20565) {
8892
9006
  if (isStrictReservedWord(parser, context, parser.getToken()))
8893
- parser.report(118);
9007
+ parser.report(120);
8894
9008
  if ((parser.getToken() & 537079808) === 537079808) {
8895
- parser.report(119);
9009
+ parser.report(121);
8896
9010
  }
8897
9011
  id = parseIdentifier(parser, context);
8898
9012
  }
@@ -8911,24 +9025,61 @@ function parseClassExpression(parser, context, privateScope, inGroup, start) {
8911
9025
  id,
8912
9026
  superClass,
8913
9027
  body,
8914
- ...(parser.options.next ? { decorators } : null),
9028
+ ...(parser.features & 1 ? { decorators } : null),
8915
9029
  }, start);
8916
9030
  }
8917
9031
  function parseDecorators(parser, context, privateScope) {
8918
9032
  const list = [];
8919
- if (parser.options.next) {
9033
+ if (parser.features & 1) {
8920
9034
  while (parser.getToken() === 133) {
8921
- list.push(parseDecoratorList(parser, context, privateScope));
9035
+ list.push(parseDecorator(parser, context, privateScope));
8922
9036
  }
8923
9037
  }
8924
9038
  return list;
8925
9039
  }
8926
- function parseDecoratorList(parser, context, privateScope) {
9040
+ function parseDecorator(parser, context, privateScope) {
8927
9041
  const start = parser.tokenStart;
8928
9042
  nextToken(parser, context | 32);
8929
9043
  const expressionStart = parser.tokenStart;
8930
- let expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, start);
8931
- expression = parseMemberOrUpdateExpression(parser, context, privateScope, expression, 0, 0, expressionStart);
9044
+ let expression;
9045
+ if (parser.getToken() === 67174411) {
9046
+ expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, start);
9047
+ }
9048
+ else {
9049
+ const token = parser.getToken();
9050
+ if (((token & 143360) !== 143360 && !isValidIdentifier(context, token)) ||
9051
+ (context & 1 && (token & 36864) === 36864)) {
9052
+ parser.report(30, KeywordDescTable[token & 255]);
9053
+ }
9054
+ if (token === 209006 && context & (2048 | 2)) {
9055
+ parser.report(112);
9056
+ }
9057
+ if (token === 241771 && context & 1024) {
9058
+ parser.report(97, 'yield');
9059
+ }
9060
+ let memberExpression = parseIdentifier(parser, context | 64);
9061
+ while (parser.getToken() === 67108877) {
9062
+ nextToken(parser, (context | 262144 | 8) ^ 8);
9063
+ const property = parsePropertyOrPrivatePropertyName(parser, context | 64, privateScope);
9064
+ memberExpression = parser.finishNode({
9065
+ type: 'MemberExpression',
9066
+ object: memberExpression,
9067
+ computed: false,
9068
+ property,
9069
+ optional: false,
9070
+ }, expressionStart);
9071
+ }
9072
+ expression = memberExpression;
9073
+ if (parser.getToken() === 67174411) {
9074
+ const args = parseArguments(parser, context, privateScope, 0);
9075
+ expression = parser.finishNode({
9076
+ type: 'CallExpression',
9077
+ callee: memberExpression,
9078
+ arguments: args,
9079
+ optional: false,
9080
+ }, expressionStart);
9081
+ }
9082
+ }
8932
9083
  return parser.finishNode({
8933
9084
  type: 'Decorator',
8934
9085
  expression,
@@ -8947,13 +9098,13 @@ function parseClassBody(parser, context, inheritedContext, scope, parentScope, k
8947
9098
  const decoratorStart = parser.tokenStart;
8948
9099
  const decorators = parseDecorators(parser, context, privateScope);
8949
9100
  if (decorators.length > 0 && parser.tokenValue === 'constructor') {
8950
- parser.report(109);
9101
+ parser.report(111);
8951
9102
  }
8952
9103
  if (parser.getToken() === 1074790415)
8953
- parser.report(108);
9104
+ parser.report(110);
8954
9105
  if (consumeOpt(parser, context, 1074790417)) {
8955
9106
  if (decorators.length > 0)
8956
- parser.report(120);
9107
+ parser.report(122);
8957
9108
  continue;
8958
9109
  }
8959
9110
  body.push(parseClassElementList(parser, context, scope, privateScope, inheritedContext, kind, decorators, 0, inGroup, decorators.length > 0 ? decoratorStart : parser.tokenStart));
@@ -9016,7 +9167,7 @@ function parseClassElementList(parser, context, scope, privateScope, inheritedCo
9016
9167
  if ((parser.getToken() & 1073741824) === 1073741824) {
9017
9168
  return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);
9018
9169
  }
9019
- if (parser.options.next)
9170
+ if (parser.features & 1)
9020
9171
  kind |= 1024;
9021
9172
  }
9022
9173
  break;
@@ -9069,12 +9220,12 @@ function parseClassElementList(parser, context, scope, privateScope, inheritedCo
9069
9220
  key = parsePrivateIdentifier(parser, context, privateScope, kind);
9070
9221
  }
9071
9222
  else
9072
- parser.report(135);
9223
+ parser.report(137);
9073
9224
  }
9074
9225
  if ((kind & 2) === 0) {
9075
9226
  if (parser.tokenValue === 'constructor') {
9076
9227
  if ((parser.getToken() & 1073741824) === 1073741824) {
9077
- parser.report(129);
9228
+ parser.report(131);
9078
9229
  }
9079
9230
  else if ((kind & 32) === 0 && parser.getToken() === 67174411) {
9080
9231
  if (kind & (768 | 16 | 128 | 8)) {
@@ -9112,7 +9263,7 @@ function parseClassElementList(parser, context, scope, privateScope, inheritedCo
9112
9263
  computed: (kind & 2) > 0,
9113
9264
  key,
9114
9265
  value,
9115
- ...(parser.options.next ? { decorators } : null),
9266
+ ...(parser.features & 1 ? { decorators } : null),
9116
9267
  }, start);
9117
9268
  }
9118
9269
  function parsePrivateIdentifier(parser, context, privateScope, kind) {
@@ -9120,7 +9271,7 @@ function parsePrivateIdentifier(parser, context, privateScope, kind) {
9120
9271
  nextToken(parser, context);
9121
9272
  const { tokenValue } = parser;
9122
9273
  if (tokenValue === 'constructor')
9123
- parser.report(128);
9274
+ parser.report(130);
9124
9275
  if (parser.options.lexical) {
9125
9276
  if (!privateScope)
9126
9277
  parser.report(4, tokenValue);
@@ -9145,7 +9296,7 @@ function parsePropertyDefinition(parser, context, privateScope, key, state, deco
9145
9296
  nextToken(parser, context | 32);
9146
9297
  const { tokenStart } = parser;
9147
9298
  if (parser.getToken() === 537079928)
9148
- parser.report(119);
9299
+ parser.report(121);
9149
9300
  const modifierFlags = 1024 |
9150
9301
  2048 |
9151
9302
  8192 |
@@ -9171,7 +9322,7 @@ function parsePropertyDefinition(parser, context, privateScope, key, state, deco
9171
9322
  value,
9172
9323
  static: (state & 32) > 0,
9173
9324
  computed: (state & 2) > 0,
9174
- ...(parser.options.next ? { decorators } : null),
9325
+ ...(parser.features & 1 ? { decorators } : null),
9175
9326
  }, start);
9176
9327
  }
9177
9328
  function parseBindingPattern(parser, context, scope, privateScope, type, origin) {
@@ -9193,10 +9344,10 @@ function parseAndClassifyIdentifier(parser, context, scope, kind, origin) {
9193
9344
  const token = parser.getToken();
9194
9345
  if (context & 1) {
9195
9346
  if ((token & 537079808) === 537079808) {
9196
- parser.report(119);
9347
+ parser.report(121);
9197
9348
  }
9198
9349
  else if ((token & 36864) === 36864 || token === -2147483526) {
9199
- parser.report(118);
9350
+ parser.report(120);
9200
9351
  }
9201
9352
  }
9202
9353
  if ((token & 20480) === 20480) {
@@ -9206,7 +9357,7 @@ function parseAndClassifyIdentifier(parser, context, scope, kind, origin) {
9206
9357
  if (context & 1024)
9207
9358
  parser.report(32);
9208
9359
  if (context & 2)
9209
- parser.report(111);
9360
+ parser.report(113);
9210
9361
  }
9211
9362
  if ((token & 255) === (241737 & 255)) {
9212
9363
  if (kind & (8 | 16))
@@ -9214,9 +9365,9 @@ function parseAndClassifyIdentifier(parser, context, scope, kind, origin) {
9214
9365
  }
9215
9366
  if (token === 209006) {
9216
9367
  if (context & 2048)
9217
- parser.report(176);
9368
+ parser.report(178);
9218
9369
  if (context & 2)
9219
- parser.report(110);
9370
+ parser.report(112);
9220
9371
  }
9221
9372
  const { tokenValue, tokenStart: start } = parser;
9222
9373
  nextToken(parser, context);
@@ -9248,7 +9399,7 @@ function parseJSXRootElementOrFragment(parser, context, privateScope, inJSXChild
9248
9399
  [children, closingElement] = parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild);
9249
9400
  const close = isEqualTagName(closingElement.name);
9250
9401
  if (isEqualTagName(openingElement.name) !== close)
9251
- parser.report(155, close);
9402
+ parser.report(157, close);
9252
9403
  }
9253
9404
  return parser.finishNode({
9254
9405
  type: 'JSXElement',
@@ -9443,7 +9594,7 @@ function parseJsxAttribute(parser, context, privateScope) {
9443
9594
  value = parseJSXExpressionContainer(parser, context, privateScope, 0, 1);
9444
9595
  break;
9445
9596
  default:
9446
- parser.report(154);
9597
+ parser.report(156);
9447
9598
  }
9448
9599
  }
9449
9600
  return parser.finishNode({
@@ -9470,7 +9621,7 @@ function parseJSXExpressionContainer(parser, context, privateScope, inJSXChild,
9470
9621
  let expression;
9471
9622
  if (parser.getToken() === 1074790415) {
9472
9623
  if (isAttr)
9473
- parser.report(157);
9624
+ parser.report(159);
9474
9625
  expression = parseJSXEmptyExpression(parser, {
9475
9626
  index: parser.startIndex,
9476
9627
  line: parser.startLine,