@sanity/cli 3.96.1-next.8.41afd49906 → 3.96.1-next.9.37d298d90e

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.
@@ -38212,6 +38212,7 @@ function requireLib$1() {
38212
38212
  IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
38213
38213
  InvalidBigIntLiteral: "Invalid BigIntLiteral.",
38214
38214
  InvalidCodePoint: "Code point out of bounds.",
38215
+ InvalidCoverDiscardElement: "'void' must be followed by an expression when not used in a binding position.",
38215
38216
  InvalidCoverInitializedName: "Invalid shorthand property initializer.",
38216
38217
  InvalidDecimal: "Invalid decimal.",
38217
38218
  InvalidDigit: ({
@@ -38329,6 +38330,7 @@ function requireLib$1() {
38329
38330
  }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`,
38330
38331
  UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
38331
38332
  UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",
38333
+ UnexpectedVoidPattern: "Unexpected void binding.",
38332
38334
  UnsupportedBind: "Binding should be performed on object property.",
38333
38335
  UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
38334
38336
  UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
@@ -38349,6 +38351,8 @@ function requireLib$1() {
38349
38351
  VarRedeclaration: ({
38350
38352
  identifierName
38351
38353
  }) => `Identifier '${identifierName}' has already been declared.`,
38354
+ VoidPatternCatchClauseParam: "A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",
38355
+ VoidPatternInitializer: "A void binding may not have an initializer.",
38352
38356
  YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
38353
38357
  YieldInParameter: "Yield expression is not allowed in formal parameters.",
38354
38358
  YieldNotInGeneratorFunction: "'yield' is only allowed within generator functions.",
@@ -38504,6 +38508,14 @@ function requireLib$1() {
38504
38508
  opts.startIndex == null && options2.startColumn > 0 ? options2.startIndex = options2.startColumn : opts.startColumn == null && options2.startIndex > 0 && (options2.startColumn = options2.startIndex);
38505
38509
  else if ((opts.startColumn == null || opts.startIndex == null) && opts.startIndex != null)
38506
38510
  throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
38511
+ if (options2.sourceType === "commonjs") {
38512
+ if (opts.allowAwaitOutsideFunction != null)
38513
+ throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");
38514
+ if (opts.allowReturnOutsideFunction != null)
38515
+ throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");
38516
+ if (opts.allowNewTargetOutsideFunction != null)
38517
+ throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.");
38518
+ }
38507
38519
  return options2;
38508
38520
  }
38509
38521
  const {
@@ -39160,7 +39172,7 @@ function requireLib$1() {
39160
39172
  startsExpr
39161
39173
  }),
39162
39174
  placeholder: createToken("%%", {
39163
- startsExpr: !0
39175
+ startsExpr
39164
39176
  }),
39165
39177
  string: createToken("string", {
39166
39178
  startsExpr
@@ -39183,10 +39195,10 @@ function requireLib$1() {
39183
39195
  eof: createToken("eof"),
39184
39196
  jsxName: createToken("jsxName"),
39185
39197
  jsxText: createToken("jsxText", {
39186
- beforeExpr: !0
39198
+ beforeExpr
39187
39199
  }),
39188
39200
  jsxTagStart: createToken("jsxTagStart", {
39189
- startsExpr: !0
39201
+ startsExpr
39190
39202
  }),
39191
39203
  jsxTagEnd: createToken("jsxTagEnd")
39192
39204
  };
@@ -39325,6 +39337,9 @@ function requireLib$1() {
39325
39337
  get allowDirectSuper() {
39326
39338
  return (this.currentThisScopeFlags() & 32) > 0;
39327
39339
  }
39340
+ get allowNewTarget() {
39341
+ return (this.currentThisScopeFlags() & 512) > 0;
39342
+ }
39328
39343
  get inClass() {
39329
39344
  return (this.currentThisScopeFlags() & 64) > 0;
39330
39345
  }
@@ -39339,7 +39354,7 @@ function requireLib$1() {
39339
39354
  } = this.scopeStack[i];
39340
39355
  if (flags & 128)
39341
39356
  return !0;
39342
- if (flags & 707)
39357
+ if (flags & 1731)
39343
39358
  return !1;
39344
39359
  }
39345
39360
  }
@@ -39371,7 +39386,7 @@ function requireLib$1() {
39371
39386
  let type2 = scope2.names.get(name) || 0;
39372
39387
  bindingType & 16 ? type2 = type2 | 4 : (scope2.firstLexicalName || (scope2.firstLexicalName = name), type2 = type2 | 2), scope2.names.set(name, type2), bindingType & 8 && this.maybeExportDefined(scope2, name);
39373
39388
  } else if (bindingType & 4)
39374
- for (let i = this.scopeStack.length - 1; i >= 0 && (scope2 = this.scopeStack[i], this.checkRedeclarationInScope(scope2, name, bindingType, loc), scope2.names.set(name, (scope2.names.get(name) || 0) | 1), this.maybeExportDefined(scope2, name), !(scope2.flags & 643)); --i)
39389
+ for (let i = this.scopeStack.length - 1; i >= 0 && (scope2 = this.scopeStack[i], this.checkRedeclarationInScope(scope2, name, bindingType, loc), scope2.names.set(name, (scope2.names.get(name) || 0) | 1), this.maybeExportDefined(scope2, name), !(scope2.flags & 1667)); --i)
39375
39390
  ;
39376
39391
  this.parser.inModule && scope2.flags & 1 && this.undefinedExports.delete(name);
39377
39392
  }
@@ -39404,7 +39419,7 @@ function requireLib$1() {
39404
39419
  const {
39405
39420
  flags
39406
39421
  } = this.scopeStack[i];
39407
- if (flags & 643)
39422
+ if (flags & 1667)
39408
39423
  return flags;
39409
39424
  }
39410
39425
  }
@@ -39413,7 +39428,7 @@ function requireLib$1() {
39413
39428
  const {
39414
39429
  flags
39415
39430
  } = this.scopeStack[i];
39416
- if (flags & 707 && !(flags & 4))
39431
+ if (flags & 1731 && !(flags & 4))
39417
39432
  return flags;
39418
39433
  }
39419
39434
  }
@@ -40182,7 +40197,7 @@ function requireLib$1() {
40182
40197
  }
40183
40198
  finishArrowValidation(node) {
40184
40199
  var _node$extra;
40185
- this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, !1), this.scope.enter(6), super.checkParams(node, !1, !0), this.scope.exit();
40200
+ this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, !1), this.scope.enter(518), super.checkParams(node, !1, !0), this.scope.exit();
40186
40201
  }
40187
40202
  forwardNoArrowParamsConversionAt(node, parse4) {
40188
40203
  let result;
@@ -40488,7 +40503,7 @@ function requireLib$1() {
40488
40503
  if (base2.type === "Identifier" && base2.name === "async" && this.state.noArrowAt.includes(startLoc.index)) {
40489
40504
  this.next();
40490
40505
  const node = this.startNodeAt(startLoc);
40491
- node.callee = base2, node.arguments = super.parseCallExpressionArguments(11), base2 = this.finishNode(node, "CallExpression");
40506
+ node.callee = base2, node.arguments = super.parseCallExpressionArguments(), base2 = this.finishNode(node, "CallExpression");
40492
40507
  } else if (base2.type === "Identifier" && base2.name === "async" && this.match(47)) {
40493
40508
  const state = this.state.clone(), arrow4 = this.tryParse((abort) => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state);
40494
40509
  if (!arrow4.error && !arrow4.aborted) return arrow4.node;
@@ -40508,11 +40523,11 @@ function requireLib$1() {
40508
40523
  return subscriptState.stop = !0, base2;
40509
40524
  this.next();
40510
40525
  const node = this.startNodeAt(startLoc);
40511
- return node.callee = base2, node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(), this.expect(10), node.arguments = this.parseCallExpressionArguments(11), node.optional = !0, this.finishCallExpression(node, !0);
40526
+ return node.callee = base2, node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(), this.expect(10), node.arguments = this.parseCallExpressionArguments(), node.optional = !0, this.finishCallExpression(node, !0);
40512
40527
  } else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) {
40513
40528
  const node = this.startNodeAt(startLoc);
40514
40529
  node.callee = base2;
40515
- const result = this.tryParse(() => (node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(), this.expect(10), node.arguments = super.parseCallExpressionArguments(11), subscriptState.optionalChainMember && (node.optional = !1), this.finishCallExpression(node, subscriptState.optionalChainMember)));
40530
+ const result = this.tryParse(() => (node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(), this.expect(10), node.arguments = super.parseCallExpressionArguments(), subscriptState.optionalChainMember && (node.optional = !1), this.finishCallExpression(node, subscriptState.optionalChainMember)));
40516
40531
  if (result.node)
40517
40532
  return result.error && (this.state = result.failState), result.node;
40518
40533
  }
@@ -41416,11 +41431,11 @@ function requireLib$1() {
41416
41431
  return this.importsStack.push(/* @__PURE__ */ new Set()), new TypeScriptScope(flags);
41417
41432
  }
41418
41433
  enter(flags) {
41419
- flags === 512 && this.importsStack.push(/* @__PURE__ */ new Set()), super.enter(flags);
41434
+ flags === 1024 && this.importsStack.push(/* @__PURE__ */ new Set()), super.enter(flags);
41420
41435
  }
41421
41436
  exit() {
41422
41437
  const flags = super.exit();
41423
- return flags === 512 && this.importsStack.pop(), flags;
41438
+ return flags === 1024 && this.importsStack.pop(), flags;
41424
41439
  }
41425
41440
  hasImport(name, allowShadow) {
41426
41441
  const len = this.importsStack.length;
@@ -42836,9 +42851,8 @@ function requireLib$1() {
42836
42851
  return this.state.type === token2 && !this.state.containsEsc;
42837
42852
  }
42838
42853
  isUnparsedContextual(nameStart, name) {
42839
- const nameEnd = nameStart + name.length;
42840
- if (this.input.slice(nameStart, nameEnd) === name) {
42841
- const nextCh = this.input.charCodeAt(nameEnd);
42854
+ if (this.input.startsWith(name, nameStart)) {
42855
+ const nextCh = this.input.charCodeAt(nameStart + name.length);
42842
42856
  return !(isIdentifierChar(nextCh) || (nextCh & 64512) === 55296);
42843
42857
  }
42844
42858
  return !1;
@@ -42927,11 +42941,12 @@ function requireLib$1() {
42927
42941
  shorthandAssignLoc,
42928
42942
  doubleProtoLoc,
42929
42943
  privateKeyLoc,
42930
- optionalParametersLoc
42931
- } = refExpressionErrors, hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc;
42944
+ optionalParametersLoc,
42945
+ voidPatternLoc
42946
+ } = refExpressionErrors, hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc || !!voidPatternLoc;
42932
42947
  if (!andThrow)
42933
42948
  return hasErrors;
42934
- shorthandAssignLoc != null && this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc), doubleProtoLoc != null && this.raise(Errors.DuplicateProto, doubleProtoLoc), privateKeyLoc != null && this.raise(Errors.UnexpectedPrivateField, privateKeyLoc), optionalParametersLoc != null && this.unexpected(optionalParametersLoc);
42949
+ shorthandAssignLoc != null && this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc), doubleProtoLoc != null && this.raise(Errors.DuplicateProto, doubleProtoLoc), privateKeyLoc != null && this.raise(Errors.UnexpectedPrivateField, privateKeyLoc), optionalParametersLoc != null && this.unexpected(optionalParametersLoc), voidPatternLoc != null && this.raise(Errors.InvalidCoverDiscardElement, voidPatternLoc);
42935
42950
  }
42936
42951
  isLiteralPropertyName() {
42937
42952
  return tokenIsLiteralPropertyName(this.state.type);
@@ -42971,7 +42986,11 @@ function requireLib$1() {
42971
42986
  }
42972
42987
  enterInitialScopes() {
42973
42988
  let paramFlags = 0;
42974
- this.inModule && (paramFlags |= 2), this.optionFlags & 32 && (paramFlags |= 1), this.scope.enter(1), this.prodParam.enter(paramFlags);
42989
+ (this.inModule || this.optionFlags & 1) && (paramFlags |= 2), this.optionFlags & 32 && (paramFlags |= 1);
42990
+ const isCommonJS = !this.inModule && this.options.sourceType === "commonjs";
42991
+ (isCommonJS || this.optionFlags & 2) && (paramFlags |= 4), this.prodParam.enter(paramFlags);
42992
+ let scopeFlags = isCommonJS ? 514 : 1;
42993
+ this.optionFlags & 4 && (scopeFlags |= 512), this.scope.enter(scopeFlags);
42975
42994
  }
42976
42995
  checkDestructuringPrivate(refExpressionErrors) {
42977
42996
  const {
@@ -42982,7 +43001,7 @@ function requireLib$1() {
42982
43001
  }
42983
43002
  class ExpressionErrors {
42984
43003
  constructor() {
42985
- this.shorthandAssignLoc = null, this.doubleProtoLoc = null, this.privateKeyLoc = null, this.optionalParametersLoc = null;
43004
+ this.shorthandAssignLoc = null, this.doubleProtoLoc = null, this.privateKeyLoc = null, this.optionalParametersLoc = null, this.voidPatternLoc = null;
42986
43005
  }
42987
43006
  }
42988
43007
  class Node {
@@ -43062,6 +43081,7 @@ function requireLib$1() {
43062
43081
  case "ArrayPattern":
43063
43082
  case "AssignmentPattern":
43064
43083
  case "RestElement":
43084
+ case "VoidPattern":
43065
43085
  break;
43066
43086
  case "ObjectExpression":
43067
43087
  this.castNodeTo(node, "ObjectPattern");
@@ -43085,7 +43105,7 @@ function requireLib$1() {
43085
43105
  this.castNodeTo(node, "ArrayPattern"), this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS);
43086
43106
  break;
43087
43107
  case "AssignmentExpression":
43088
- node.operator !== "=" && this.raise(Errors.MissingEqInAssignment, node.left.loc.end), this.castNodeTo(node, "AssignmentPattern"), delete node.operator, this.toAssignable(node.left, isLHS);
43108
+ node.operator !== "=" && this.raise(Errors.MissingEqInAssignment, node.left.loc.end), this.castNodeTo(node, "AssignmentPattern"), delete node.operator, node.left.type === "VoidPattern" && this.raise(Errors.VoidPatternInitializer, node.left), this.toAssignable(node.left, isLHS);
43089
43109
  break;
43090
43110
  case "ParenthesizedExpression":
43091
43111
  this.toAssignable(parenthesized, isLHS);
@@ -43125,6 +43145,7 @@ function requireLib$1() {
43125
43145
  case "ArrayPattern":
43126
43146
  case "AssignmentPattern":
43127
43147
  case "RestElement":
43148
+ case "VoidPattern":
43128
43149
  return !0;
43129
43150
  case "ObjectExpression": {
43130
43151
  const last2 = node.properties.length - 1;
@@ -43161,7 +43182,9 @@ function requireLib$1() {
43161
43182
  }
43162
43183
  parseRestBinding() {
43163
43184
  const node = this.startNode();
43164
- return this.next(), node.argument = this.parseBindingAtom(), this.finishNode(node, "RestElement");
43185
+ this.next();
43186
+ const argument = this.parseBindingAtom();
43187
+ return argument.type === "VoidPattern" && this.raise(Errors.UnexpectedVoidPattern, argument), node.argument = argument, this.finishNode(node, "RestElement");
43165
43188
  }
43166
43189
  parseBindingAtom() {
43167
43190
  switch (this.state.type) {
@@ -43171,6 +43194,8 @@ function requireLib$1() {
43171
43194
  }
43172
43195
  case 5:
43173
43196
  return this.parseObjectLike(8, !0);
43197
+ case 88:
43198
+ return this.parseVoidPattern(null);
43174
43199
  }
43175
43200
  return this.parseIdentifier();
43176
43201
  }
@@ -43200,7 +43225,7 @@ function requireLib$1() {
43200
43225
  return elts;
43201
43226
  }
43202
43227
  parseBindingRestProperty(prop) {
43203
- return this.next(), prop.argument = this.parseIdentifier(), this.checkCommaAfterRest(125), this.finishNode(prop, "RestElement");
43228
+ return this.next(), this.hasPlugin("discardBinding") && this.match(88) ? (prop.argument = this.parseVoidPattern(null), this.raise(Errors.UnexpectedVoidPattern, prop.argument)) : prop.argument = this.parseIdentifier(), this.checkCommaAfterRest(125), this.finishNode(prop, "RestElement");
43204
43229
  }
43205
43230
  parseBindingProperty() {
43206
43231
  const {
@@ -43222,7 +43247,7 @@ function requireLib$1() {
43222
43247
  parseMaybeDefault(startLoc, left) {
43223
43248
  if (startLoc ?? (startLoc = this.state.startLoc), left = left ?? this.parseBindingAtom(), !this.eat(29)) return left;
43224
43249
  const node = this.startNodeAt(startLoc);
43225
- return node.left = left, node.right = this.parseMaybeAssignAllowIn(), this.finishNode(node, "AssignmentPattern");
43250
+ return left.type === "VoidPattern" && this.raise(Errors.VoidPatternInitializer, left), node.left = left, node.right = this.parseMaybeAssignAllowIn(), this.finishNode(node, "AssignmentPattern");
43226
43251
  }
43227
43252
  isValidLVal(type2, isUnparenthesizedInAssign, binding) {
43228
43253
  switch (type2) {
@@ -43238,6 +43263,8 @@ function requireLib$1() {
43238
43263
  return "elements";
43239
43264
  case "ObjectPattern":
43240
43265
  return "properties";
43266
+ case "VoidPattern":
43267
+ return !0;
43241
43268
  }
43242
43269
  return !1;
43243
43270
  }
@@ -43262,7 +43289,7 @@ function requireLib$1() {
43262
43289
  } = expression;
43263
43290
  checkClashes && (checkClashes.has(name) ? this.raise(Errors.ParamDupe, expression) : checkClashes.add(name));
43264
43291
  return;
43265
- }
43292
+ } else type2 === "VoidPattern" && ancestor.type === "CatchClause" && this.raise(Errors.VoidPatternCatchClauseParam, expression);
43266
43293
  const validity = this.isValidLVal(type2, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
43267
43294
  if (validity === !0) return;
43268
43295
  if (validity === !1) {
@@ -43416,7 +43443,8 @@ function requireLib$1() {
43416
43443
  UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.",
43417
43444
  UnsupportedSignatureParameterKind: ({
43418
43445
  type: type2
43419
- }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type2}.`
43446
+ }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type2}.`,
43447
+ UsingDeclarationInAmbientContext: (kind) => `'${kind}' declarations are not allowed in ambient contexts.`
43420
43448
  });
43421
43449
  function keywordTypeFromName(value) {
43422
43450
  switch (value) {
@@ -43995,7 +44023,7 @@ function requireLib$1() {
43995
44023
  return node.checkType = type2, node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType()), this.expect(17), node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()), this.expect(14), node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()), this.finishNode(node, "TSConditionalType");
43996
44024
  }
43997
44025
  isAbstractConstructorSignature() {
43998
- return this.isContextual(124) && this.lookahead().type === 77;
44026
+ return this.isContextual(124) && this.isLookaheadContextual("new");
43999
44027
  }
44000
44028
  tsParseNonConditionalType() {
44001
44029
  return this.tsIsStartOfFunctionType() ? this.tsParseFunctionOrConstructorType("TSFunctionType") : this.match(77) ? this.tsParseFunctionOrConstructorType("TSConstructorType") : this.isAbstractConstructorSignature() ? this.tsParseFunctionOrConstructorType("TSConstructorType", !0) : this.tsParseUnionTypeOrHigher();
@@ -44024,7 +44052,7 @@ function requireLib$1() {
44024
44052
  }
44025
44053
  tsParseTypeAliasDeclaration(node) {
44026
44054
  return node.id = this.parseIdentifier(), this.checkIdentifier(node.id, 2), node.typeAnnotation = this.tsInType(() => {
44027
- if (node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers), this.expect(29), this.isContextual(114) && this.lookahead().type !== 16) {
44055
+ if (node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers), this.expect(29), this.isContextual(114) && this.lookaheadCharCode() !== 46) {
44028
44056
  const node2 = this.startNode();
44029
44057
  return this.next(), this.finishNode(node2, "TSIntrinsicKeyword");
44030
44058
  }
@@ -44100,11 +44128,11 @@ function requireLib$1() {
44100
44128
  const inner = this.startNode();
44101
44129
  this.tsParseModuleOrNamespaceDeclaration(inner, !0), node.body = inner;
44102
44130
  } else
44103
- this.scope.enter(512), this.prodParam.enter(0), node.body = this.tsParseModuleBlock(), this.prodParam.exit(), this.scope.exit();
44131
+ this.scope.enter(1024), this.prodParam.enter(0), node.body = this.tsParseModuleBlock(), this.prodParam.exit(), this.scope.exit();
44104
44132
  return this.finishNode(node, "TSModuleDeclaration");
44105
44133
  }
44106
44134
  tsParseAmbientExternalModuleDeclaration(node) {
44107
- return this.isContextual(112) ? (node.kind = "global", node.global = !0, node.id = this.parseIdentifier()) : this.match(134) ? (node.kind = "module", node.id = super.parseStringLiteral(this.state.value)) : this.unexpected(), this.match(5) ? (this.scope.enter(512), this.prodParam.enter(0), node.body = this.tsParseModuleBlock(), this.prodParam.exit(), this.scope.exit()) : this.semicolon(), this.finishNode(node, "TSModuleDeclaration");
44135
+ return this.isContextual(112) ? (node.kind = "global", node.global = !0, node.id = this.parseIdentifier()) : this.match(134) ? (node.kind = "module", node.id = super.parseStringLiteral(this.state.value)) : this.unexpected(), this.match(5) ? (this.scope.enter(1024), this.prodParam.enter(0), node.body = this.tsParseModuleBlock(), this.prodParam.exit(), this.scope.exit()) : this.semicolon(), this.finishNode(node, "TSModuleDeclaration");
44108
44136
  }
44109
44137
  tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) {
44110
44138
  node.isExport = isExport || !1, node.id = maybeDefaultIdentifier || this.parseIdentifier(), this.checkIdentifier(node.id, 4096), this.expect(29);
@@ -44162,11 +44190,11 @@ function requireLib$1() {
44162
44190
  declare: !0
44163
44191
  }));
44164
44192
  case 107:
44165
- if (this.hasPlugin("explicitResourceManagement") && this.isUsing())
44193
+ if (this.isUsing())
44166
44194
  return this.raise(TSErrors.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare"), node.declare = !0, this.parseVarStatement(node, "using", !0);
44167
44195
  break;
44168
44196
  case 96:
44169
- if (this.hasPlugin("explicitResourceManagement") && this.isAwaitUsing())
44197
+ if (this.isAwaitUsing())
44170
44198
  return this.raise(TSErrors.InvalidModifierOnAwaitUsingDeclaration, this.state.startLoc, "declare"), node.declare = !0, this.next(), this.parseVarStatement(node, "await using", !0);
44171
44199
  break;
44172
44200
  case 129: {
@@ -44192,7 +44220,7 @@ function requireLib$1() {
44192
44220
  }
44193
44221
  case "global":
44194
44222
  if (this.match(5)) {
44195
- this.scope.enter(512), this.prodParam.enter(0);
44223
+ this.scope.enter(1024), this.prodParam.enter(0);
44196
44224
  const mod = node;
44197
44225
  return mod.kind = "global", node.global = !0, mod.id = expr, mod.body = this.tsParseModuleBlock(), this.scope.exit(), this.prodParam.exit(), this.finishNode(mod, "TSModuleDeclaration");
44198
44226
  }
@@ -44331,7 +44359,7 @@ function requireLib$1() {
44331
44359
  }
44332
44360
  if (!noCalls && this.eat(10)) {
44333
44361
  const node2 = this.startNodeAt(startLoc);
44334
- return node2.callee = base2, node2.arguments = this.parseCallExpressionArguments(11), this.tsCheckForInvalidTypeCasts(node2.arguments), node2.typeParameters = typeArguments, state.optionalChainMember && (node2.optional = isOptionalCall), this.finishCallExpression(node2, state.optionalChainMember);
44362
+ return node2.callee = base2, node2.arguments = this.parseCallExpressionArguments(), this.tsCheckForInvalidTypeCasts(node2.arguments), node2.typeParameters = typeArguments, state.optionalChainMember && (node2.optional = isOptionalCall), this.finishCallExpression(node2, state.optionalChainMember);
44335
44363
  }
44336
44364
  const tokenType = this.state.type;
44337
44365
  if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak())
@@ -44412,7 +44440,7 @@ function requireLib$1() {
44412
44440
  return super.parseExport(node, decorators);
44413
44441
  }
44414
44442
  isAbstractClass() {
44415
- return this.isContextual(124) && this.lookahead().type === 80;
44443
+ return this.isContextual(124) && this.isLookaheadContextual("class");
44416
44444
  }
44417
44445
  parseExportDefaultExpression() {
44418
44446
  if (this.isAbstractClass()) {
@@ -44430,6 +44458,8 @@ function requireLib$1() {
44430
44458
  isAmbientContext
44431
44459
  } = this.state, declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext);
44432
44460
  if (!isAmbientContext) return declaration;
44461
+ if (!node.declare && (kind === "using" || kind === "await using"))
44462
+ return this.raiseOverwrite(TSErrors.UsingDeclarationInAmbientContext, node, kind), declaration;
44433
44463
  for (const {
44434
44464
  id,
44435
44465
  init
@@ -45033,7 +45063,10 @@ function requireLib$1() {
45033
45063
  node && node.type === "Placeholder" && node.expectedNode === "Expression" ? node.expectedNode = "Pattern" : super.toAssignable(node, isLHS);
45034
45064
  }
45035
45065
  chStartsBindingIdentifier(ch, pos2) {
45036
- return !!(super.chStartsBindingIdentifier(ch, pos2) || this.lookahead().type === 133);
45066
+ if (super.chStartsBindingIdentifier(ch, pos2))
45067
+ return !0;
45068
+ const next = this.nextTokenStart();
45069
+ return this.input.charCodeAt(next) === 37 && this.input.charCodeAt(next + 1) === 37;
45037
45070
  }
45038
45071
  verifyBreakContinue(node, isBreak) {
45039
45072
  node.label && node.label.type === "Placeholder" || super.verifyBreakContinue(node, isBreak);
@@ -45193,6 +45226,8 @@ function requireLib$1() {
45193
45226
  }
45194
45227
  if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07")
45195
45228
  throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");
45229
+ if (pluginsMap.has("discardBinding") && pluginsMap.get("discardBinding").syntaxType !== "void")
45230
+ throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.");
45196
45231
  }
45197
45232
  const mixinPlugins = {
45198
45233
  estree,
@@ -45263,7 +45298,7 @@ function requireLib$1() {
45263
45298
  if (node.operator = operator, this.match(29)) {
45264
45299
  this.toAssignable(left, !0), node.left = left;
45265
45300
  const startIndex = startLoc.index;
45266
- refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex && (refExpressionErrors.doubleProtoLoc = null), refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex && (refExpressionErrors.shorthandAssignLoc = null), refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex && (this.checkDestructuringPrivate(refExpressionErrors), refExpressionErrors.privateKeyLoc = null);
45301
+ refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex && (refExpressionErrors.doubleProtoLoc = null), refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex && (refExpressionErrors.shorthandAssignLoc = null), refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex && (this.checkDestructuringPrivate(refExpressionErrors), refExpressionErrors.privateKeyLoc = null), refExpressionErrors.voidPatternLoc != null && refExpressionErrors.voidPatternLoc.index >= startIndex && (refExpressionErrors.voidPatternLoc = null);
45267
45302
  } else
45268
45303
  node.left = left;
45269
45304
  return this.next(), node.right = this.parseMaybeAssign(), this.checkLVal(left, this.finishNode(node, "AssignmentExpression")), node;
@@ -45462,7 +45497,7 @@ function requireLib$1() {
45462
45497
  maybeAsyncArrow,
45463
45498
  optionalChainMember
45464
45499
  } = state;
45465
- maybeAsyncArrow && (this.expressionScope.enter(newAsyncArrowScope()), refExpressionErrors = new ExpressionErrors()), optionalChainMember && (node.optional = optional), optional ? node.arguments = this.parseCallExpressionArguments(11) : node.arguments = this.parseCallExpressionArguments(11, base2.type !== "Super", node, refExpressionErrors);
45500
+ maybeAsyncArrow && (this.expressionScope.enter(newAsyncArrowScope()), refExpressionErrors = new ExpressionErrors()), optionalChainMember && (node.optional = optional), optional ? node.arguments = this.parseCallExpressionArguments() : node.arguments = this.parseCallExpressionArguments(base2.type !== "Super", node, refExpressionErrors);
45466
45501
  let finishedNode = this.finishCallExpression(node, optionalChainMember);
45467
45502
  return maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional ? (state.stop = !0, this.checkDestructuringPrivate(refExpressionErrors), this.expressionScope.validateAsPattern(), this.expressionScope.exit(), finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode)) : (maybeAsyncArrow && (this.checkExpressionErrors(refExpressionErrors, !0), this.expressionScope.exit()), this.toReferencedArguments(finishedNode)), this.state.maybeInArrowParameters = oldMaybeInArrowParameters, finishedNode;
45468
45503
  }
@@ -45485,18 +45520,18 @@ function requireLib$1() {
45485
45520
  arg.type === "SpreadElement" && this.raise(Errors.ImportCallSpreadArgument, arg);
45486
45521
  return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
45487
45522
  }
45488
- parseCallExpressionArguments(close, allowPlaceholder, nodeForExtra, refExpressionErrors) {
45523
+ parseCallExpressionArguments(allowPlaceholder, nodeForExtra, refExpressionErrors) {
45489
45524
  const elts = [];
45490
45525
  let first2 = !0;
45491
45526
  const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
45492
- for (this.state.inFSharpPipelineDirectBody = !1; !this.eat(close); ) {
45527
+ for (this.state.inFSharpPipelineDirectBody = !1; !this.eat(11); ) {
45493
45528
  if (first2)
45494
45529
  first2 = !1;
45495
- else if (this.expect(12), this.match(close)) {
45530
+ else if (this.expect(12), this.match(11)) {
45496
45531
  nodeForExtra && this.addTrailingCommaExtraToNode(nodeForExtra), this.next();
45497
45532
  break;
45498
45533
  }
45499
- elts.push(this.parseExprListItem(!1, refExpressionErrors, allowPlaceholder));
45534
+ elts.push(this.parseExprListItem(11, !1, refExpressionErrors, allowPlaceholder));
45500
45535
  }
45501
45536
  return this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody, elts;
45502
45537
  }
@@ -45743,7 +45778,7 @@ function requireLib$1() {
45743
45778
  if (spreadStartLoc = this.state.startLoc, exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc)), !this.checkCommaAfterRest(41))
45744
45779
  break;
45745
45780
  } else
45746
- exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem));
45781
+ exprList.push(this.parseMaybeAssignAllowInOrVoidPattern(11, refExpressionErrors, this.parseParenItem));
45747
45782
  }
45748
45783
  const innerEndLoc = this.state.lastTokEndLoc;
45749
45784
  this.expect(11), this.state.maybeInArrowParameters = oldMaybeInArrowParameters, this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
@@ -45772,7 +45807,7 @@ function requireLib$1() {
45772
45807
  const meta = this.createIdentifier(this.startNodeAtNode(node), "new");
45773
45808
  this.next();
45774
45809
  const metaProp = this.parseMetaProperty(node, meta, "target");
45775
- return !this.scope.inNonArrowFunction && !this.scope.inClass && !(this.optionFlags & 4) && this.raise(Errors.UnexpectedNewTarget, metaProp), metaProp;
45810
+ return this.scope.allowNewTarget || this.raise(Errors.UnexpectedNewTarget, metaProp), metaProp;
45776
45811
  }
45777
45812
  return this.parseNew(node);
45778
45813
  }
@@ -45886,7 +45921,7 @@ function requireLib$1() {
45886
45921
  }
45887
45922
  parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
45888
45923
  if (prop.shorthand = !1, this.eat(14))
45889
- return prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors), this.finishObjectProperty(prop);
45924
+ return prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowInOrVoidPattern(8, refExpressionErrors), this.finishObjectProperty(prop);
45890
45925
  if (!prop.computed && prop.key.type === "Identifier") {
45891
45926
  if (this.checkReservedWord(prop.key.name, prop.key.loc.start, !0, !1), isPattern)
45892
45927
  prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key));
@@ -45946,7 +45981,7 @@ function requireLib$1() {
45946
45981
  node.id = null, node.generator = !1, node.async = isAsync;
45947
45982
  }
45948
45983
  parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope = !1) {
45949
- this.initFunction(node, isAsync), node.generator = isGenerator, this.scope.enter(18 | (inClassScope ? 64 : 0) | (allowDirectSuper ? 32 : 0)), this.prodParam.enter(functionFlags(isAsync, node.generator)), this.parseFunctionParams(node, isConstructor);
45984
+ this.initFunction(node, isAsync), node.generator = isGenerator, this.scope.enter(530 | (inClassScope ? 576 : 0) | (allowDirectSuper ? 32 : 0)), this.prodParam.enter(functionFlags(isAsync, node.generator)), this.parseFunctionParams(node, isConstructor);
45950
45985
  const finishedNode = this.parseFunctionBodyAndFinish(node, type2, !0);
45951
45986
  return this.prodParam.exit(), this.scope.exit(), finishedNode;
45952
45987
  }
@@ -45958,7 +45993,7 @@ function requireLib$1() {
45958
45993
  return this.next(), node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node), this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody, this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression");
45959
45994
  }
45960
45995
  parseArrowExpression(node, params, isAsync, trailingCommaLoc) {
45961
- this.scope.enter(6);
45996
+ this.scope.enter(518);
45962
45997
  let flags = functionFlags(isAsync, !1);
45963
45998
  !this.match(5) && this.prodParam.hasIn && (flags |= 8), this.prodParam.enter(flags), this.initFunction(node, isAsync);
45964
45999
  const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
@@ -46010,11 +46045,11 @@ function requireLib$1() {
46010
46045
  nodeForExtra && this.addTrailingCommaExtraToNode(nodeForExtra), this.next();
46011
46046
  break;
46012
46047
  }
46013
- elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));
46048
+ elts.push(this.parseExprListItem(close, allowEmpty, refExpressionErrors));
46014
46049
  }
46015
46050
  return elts;
46016
46051
  }
46017
- parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) {
46052
+ parseExprListItem(close, allowEmpty, refExpressionErrors, allowPlaceholder) {
46018
46053
  let elt;
46019
46054
  if (this.match(12))
46020
46055
  allowEmpty || this.raise(Errors.UnexpectedToken, this.state.curPosition(), {
@@ -46028,7 +46063,7 @@ function requireLib$1() {
46028
46063
  const node = this.startNode();
46029
46064
  this.next(), elt = this.finishNode(node, "ArgumentPlaceholder");
46030
46065
  } else
46031
- elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem);
46066
+ elt = this.parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, this.parseParenItem);
46032
46067
  return elt;
46033
46068
  }
46034
46069
  parseIdentifier(liberal) {
@@ -46086,7 +46121,7 @@ function requireLib$1() {
46086
46121
  }
46087
46122
  }
46088
46123
  recordAwaitIfAllowed() {
46089
- const isAwaitAllowed = this.prodParam.hasAwait || this.optionFlags & 1 && !this.scope.inFunction;
46124
+ const isAwaitAllowed = this.prodParam.hasAwait;
46090
46125
  return isAwaitAllowed && !this.scope.inFunction && (this.state.hasTopLevelAwait = !0), isAwaitAllowed;
46091
46126
  }
46092
46127
  parseAwait(startLoc) {
@@ -46256,6 +46291,19 @@ function requireLib$1() {
46256
46291
  }
46257
46292
  return this.finishNode(node, "ModuleExpression");
46258
46293
  }
46294
+ parseVoidPattern(refExpressionErrors) {
46295
+ this.expectPlugin("discardBinding");
46296
+ const node = this.startNode();
46297
+ return refExpressionErrors != null && (refExpressionErrors.voidPatternLoc = this.state.startLoc), this.next(), this.finishNode(node, "VoidPattern");
46298
+ }
46299
+ parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, afterLeftParse) {
46300
+ if (refExpressionErrors != null && this.match(88)) {
46301
+ const nextCode = this.lookaheadCharCode();
46302
+ if (nextCode === 44 || nextCode === (close === 3 ? 93 : close === 8 ? 125 : 41) || nextCode === 61)
46303
+ return this.parseMaybeDefault(this.state.startLoc, this.parseVoidPattern(refExpressionErrors));
46304
+ }
46305
+ return this.parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse);
46306
+ }
46259
46307
  parsePropertyNamePrefixOperator(prop) {
46260
46308
  }
46261
46309
  }
@@ -46351,9 +46399,9 @@ function requireLib$1() {
46351
46399
  }
46352
46400
  class StatementParser extends ExpressionParser {
46353
46401
  parseTopLevel(file, program) {
46354
- return file.program = this.parseProgram(program), file.comments = this.comments, this.optionFlags & 256 && (file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex)), this.finishNode(file, "File");
46402
+ return file.program = this.parseProgram(program, 140, this.options.sourceType === "module" ? "module" : "script"), file.comments = this.comments, this.optionFlags & 256 && (file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex)), this.finishNode(file, "File");
46355
46403
  }
46356
- parseProgram(program, end = 140, sourceType = this.options.sourceType) {
46404
+ parseProgram(program, end, sourceType) {
46357
46405
  if (program.sourceType = sourceType, program.interpreter = this.parseInterpreterDirective(), this.parseBlockBody(program, !0, !0, end), this.inModule) {
46358
46406
  if (!(this.optionFlags & 64) && this.scope.undefinedExports.size > 0)
46359
46407
  for (const [localName, at] of Array.from(this.scope.undefinedExports))
@@ -46384,6 +46432,17 @@ function requireLib$1() {
46384
46432
  const next = this.nextTokenInLineStart(), nextCh = this.codePointAtPos(next);
46385
46433
  return this.chStartsBindingIdentifier(nextCh, next);
46386
46434
  }
46435
+ isForUsing() {
46436
+ if (!this.isContextual(107))
46437
+ return !1;
46438
+ const next = this.nextTokenInLineStart(), nextCh = this.codePointAtPos(next);
46439
+ if (this.isUnparsedContextual(next, "of")) {
46440
+ const nextCharAfterOf = this.lookaheadCharCodeSince(next + 2);
46441
+ if (nextCharAfterOf !== 61 && nextCharAfterOf !== 58 && nextCharAfterOf !== 59)
46442
+ return !1;
46443
+ }
46444
+ return !!(this.chStartsBindingIdentifier(nextCh, next) || this.isUnparsedContextual(next, "void"));
46445
+ }
46387
46446
  isAwaitUsing() {
46388
46447
  if (!this.isContextual(96))
46389
46448
  return !1;
@@ -46392,7 +46451,7 @@ function requireLib$1() {
46392
46451
  next = this.nextTokenInLineStartSince(next + 5);
46393
46452
  const nextCh = this.codePointAtPos(next);
46394
46453
  if (this.chStartsBindingIdentifier(nextCh, next))
46395
- return this.expectPlugin("explicitResourceManagement"), !0;
46454
+ return !0;
46396
46455
  }
46397
46456
  return !1;
46398
46457
  }
@@ -46417,19 +46476,6 @@ function requireLib$1() {
46417
46476
  const next = this.nextTokenInLineStart(), nextCh = this.codePointAtPos(next);
46418
46477
  return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next);
46419
46478
  }
46420
- allowsForUsing() {
46421
- const {
46422
- type: type2,
46423
- containsEsc,
46424
- end
46425
- } = this.lookahead();
46426
- if (type2 === 102 && !containsEsc) {
46427
- const nextCharAfterOf = this.lookaheadCharCodeSince(end);
46428
- if (nextCharAfterOf !== 61 && nextCharAfterOf !== 58 && nextCharAfterOf !== 59)
46429
- return !1;
46430
- }
46431
- return tokenIsIdentifier(type2) && !this.hasFollowingLineBreak() ? (this.expectPlugin("explicitResourceManagement"), !0) : !1;
46432
- }
46433
46479
  allowsUsing() {
46434
46480
  return (this.scope.inModule || !this.scope.inTopLevel) && !this.scope.inBareCaseStatement;
46435
46481
  }
@@ -46485,7 +46531,7 @@ function requireLib$1() {
46485
46531
  case 107:
46486
46532
  if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace())
46487
46533
  break;
46488
- return this.expectPlugin("explicitResourceManagement"), this.allowsUsing() ? allowDeclaration || this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc) : this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc), this.parseVarStatement(node, "using");
46534
+ return this.allowsUsing() ? allowDeclaration || this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc) : this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc), this.parseVarStatement(node, "using");
46489
46535
  case 100: {
46490
46536
  if (this.state.containsEsc)
46491
46537
  break;
@@ -46576,7 +46622,7 @@ function requireLib$1() {
46576
46622
  parseMaybeDecoratorArguments(expr, startLoc) {
46577
46623
  if (this.eat(10)) {
46578
46624
  const node = this.startNodeAt(startLoc);
46579
- return node.callee = expr, node.arguments = this.parseCallExpressionArguments(11), this.toReferencedList(node.arguments), this.finishNode(node, "CallExpression");
46625
+ return node.callee = expr, node.arguments = this.parseCallExpressionArguments(), this.toReferencedList(node.arguments), this.finishNode(node, "CallExpression");
46580
46626
  }
46581
46627
  return expr;
46582
46628
  }
@@ -46615,7 +46661,7 @@ function requireLib$1() {
46615
46661
  return awaitAt !== null && this.unexpected(awaitAt), this.parseFor(node, null);
46616
46662
  const startsWithLet = this.isContextual(100);
46617
46663
  {
46618
- const startsWithAwaitUsing = this.isAwaitUsing(), starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(107) && this.allowsForUsing(), isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration;
46664
+ const startsWithAwaitUsing = this.isAwaitUsing(), starsWithUsingDeclaration = startsWithAwaitUsing || this.isForUsing(), isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration;
46619
46665
  if (this.match(74) || this.match(75) || isLetOrUsing) {
46620
46666
  const initNode = this.startNode();
46621
46667
  let kind;
@@ -46642,7 +46688,7 @@ function requireLib$1() {
46642
46688
  return this.next(), node.test = this.parseHeaderExpression(), node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(), node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null, this.finishNode(node, "IfStatement");
46643
46689
  }
46644
46690
  parseReturnStatement(node) {
46645
- return !this.prodParam.hasReturn && !(this.optionFlags & 2) && this.raise(Errors.IllegalReturn, this.state.startLoc), this.next(), this.isLineTerminator() ? node.argument = null : (node.argument = this.parseExpression(), this.semicolon()), this.finishNode(node, "ReturnStatement");
46691
+ return this.prodParam.hasReturn || this.raise(Errors.IllegalReturn, this.state.startLoc), this.next(), this.isLineTerminator() ? node.argument = null : (node.argument = this.parseExpression(), this.semicolon()), this.finishNode(node, "ReturnStatement");
46646
46692
  }
46647
46693
  parseSwitchStatement(node) {
46648
46694
  this.next(), node.discriminant = this.parseHeaderExpression();
@@ -46762,7 +46808,7 @@ function requireLib$1() {
46762
46808
  }
46763
46809
  parseVarId(decl, kind) {
46764
46810
  const id = this.parseBindingAtom();
46765
- (kind === "using" || kind === "await using") && (id.type === "ArrayPattern" || id.type === "ObjectPattern") && this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start), this.checkLVal(id, {
46811
+ kind === "using" || kind === "await using" ? (id.type === "ArrayPattern" || id.type === "ObjectPattern") && this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start) : id.type === "VoidPattern" && this.raise(Errors.UnexpectedVoidPattern, id.loc.start), this.checkLVal(id, {
46766
46812
  type: "VariableDeclarator"
46767
46813
  }, kind === "var" ? 5 : 8201), decl.id = id;
46768
46814
  }
@@ -46773,7 +46819,7 @@ function requireLib$1() {
46773
46819
  const hangingDeclaration = flags & 2, isDeclaration = !!(flags & 1), requireId = isDeclaration && !(flags & 4), isAsync = !!(flags & 8);
46774
46820
  this.initFunction(node, isAsync), this.match(55) && (hangingDeclaration && this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc), this.next(), node.generator = !0), isDeclaration && (node.id = this.parseFunctionId(requireId));
46775
46821
  const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
46776
- return this.state.maybeInArrowParameters = !1, this.scope.enter(2), this.prodParam.enter(functionFlags(isAsync, node.generator)), isDeclaration || (node.id = this.parseFunctionId()), this.parseFunctionParams(node, !1), this.withSmartMixTopicForbiddingContext(() => {
46822
+ return this.state.maybeInArrowParameters = !1, this.scope.enter(514), this.prodParam.enter(functionFlags(isAsync, node.generator)), isDeclaration || (node.id = this.parseFunctionId()), this.parseFunctionParams(node, !1), this.withSmartMixTopicForbiddingContext(() => {
46777
46823
  this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression");
46778
46824
  }), this.prodParam.exit(), this.scope.exit(), isDeclaration && !hangingDeclaration && this.registerFunctionStatementId(node), this.state.maybeInArrowParameters = oldMaybeInArrowParameters, node;
46779
46825
  }
@@ -46905,7 +46951,7 @@ function requireLib$1() {
46905
46951
  }
46906
46952
  parseClassStaticBlock(classBody, member) {
46907
46953
  var _member$decorators;
46908
- this.scope.enter(208);
46954
+ this.scope.enter(720);
46909
46955
  const oldLabels = this.state.labels;
46910
46956
  this.state.labels = [], this.prodParam.enter(0);
46911
46957
  const body = member.body = [];
@@ -46947,7 +46993,7 @@ function requireLib$1() {
46947
46993
  return this.parseInitializer(node), this.semicolon(), this.finishNode(node, "ClassAccessorProperty");
46948
46994
  }
46949
46995
  parseInitializer(node) {
46950
- this.scope.enter(80), this.expressionScope.enter(newExpressionScope()), this.prodParam.enter(0), node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null, this.expressionScope.exit(), this.prodParam.exit(), this.scope.exit();
46996
+ this.scope.enter(592), this.expressionScope.enter(newExpressionScope()), this.prodParam.enter(0), node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null, this.expressionScope.exit(), this.prodParam.exit(), this.scope.exit();
46951
46997
  }
46952
46998
  parseClassId(node, isStatement, optionalId, bindingType = 8331) {
46953
46999
  if (tokenIsIdentifier(this.state.type))
@@ -47042,7 +47088,7 @@ function requireLib$1() {
47042
47088
  return this.parseClass(expr, !0, !0);
47043
47089
  if (this.match(26))
47044
47090
  return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === !0 && this.raise(Errors.DecoratorBeforeExport, this.state.startLoc), this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1), this.startNode()), !0, !0);
47045
- if (this.match(75) || this.match(74) || this.isLet() || this.hasPlugin("explicitResourceManagement") && (this.isUsing() || this.isAwaitUsing()))
47091
+ if (this.match(75) || this.match(74) || this.isLet() || this.isUsing() || this.isAwaitUsing())
47046
47092
  throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
47047
47093
  const res = this.parseMaybeAssignAllowIn();
47048
47094
  return this.semicolon(), res;
@@ -47058,10 +47104,8 @@ function requireLib$1() {
47058
47104
  if (type2 === 95 && !this.state.containsEsc || type2 === 100)
47059
47105
  return !1;
47060
47106
  if ((type2 === 130 || type2 === 129) && !this.state.containsEsc) {
47061
- const {
47062
- type: nextType
47063
- } = this.lookahead();
47064
- if (tokenIsIdentifier(nextType) && nextType !== 98 || nextType === 5)
47107
+ const next2 = this.nextTokenStart(), nextChar = this.input.charCodeAt(next2);
47108
+ if (nextChar === 123 || this.chStartsBindingIdentifier(nextChar, next2) && !this.input.startsWith("from", next2))
47065
47109
  return this.expectOnePlugin(["flow", "typescript"]), !1;
47066
47110
  }
47067
47111
  } else if (!this.match(65))
@@ -47082,15 +47126,7 @@ function requireLib$1() {
47082
47126
  const {
47083
47127
  type: type2
47084
47128
  } = this.state;
47085
- if (type2 === 26 && (this.expectOnePlugin(["decorators", "decorators-legacy"]), this.hasPlugin("decorators")))
47086
- return this.getPluginOption("decorators", "decoratorsBeforeExport") === !0 && this.raise(Errors.DecoratorBeforeExport, this.state.startLoc), !0;
47087
- if (this.hasPlugin("explicitResourceManagement")) {
47088
- if (this.isUsing())
47089
- return this.raise(Errors.UsingDeclarationExport, this.state.startLoc), !0;
47090
- if (this.isAwaitUsing())
47091
- return this.raise(Errors.UsingDeclarationExport, this.state.startLoc), !0;
47092
- }
47093
- return type2 === 74 || type2 === 75 || type2 === 68 || type2 === 80 || this.isLet() || this.isAsyncFunction();
47129
+ return type2 === 26 && (this.expectOnePlugin(["decorators", "decorators-legacy"]), this.hasPlugin("decorators")) ? (this.getPluginOption("decorators", "decoratorsBeforeExport") === !0 && this.raise(Errors.DecoratorBeforeExport, this.state.startLoc), !0) : this.isUsing() ? (this.raise(Errors.UsingDeclarationExport, this.state.startLoc), !0) : this.isAwaitUsing() ? (this.raise(Errors.UsingDeclarationExport, this.state.startLoc), !0) : type2 === 74 || type2 === 75 || type2 === 68 || type2 === 80 || this.isLet() || this.isAsyncFunction();
47094
47130
  }
47095
47131
  checkExport(node, checkNames, isDefault, isFrom) {
47096
47132
  if (checkNames) {