@sanity/cli 3.69.0 → 3.70.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.
@@ -26703,32 +26703,34 @@ async function applyEnvVariables(root2, envData, targetName = ".env") {
26703
26703
  const templatePath = await Promise.any(
26704
26704
  templateValidator.ENV_TEMPLATE_FILES.map(async (file) => (await fs.access(path$3.join(root2, file)), file))
26705
26705
  ).catch(() => {
26706
- throw new Error("Could not find .env.template, .env.example or .env.local.example file");
26707
26706
  });
26708
- try {
26709
- const templateContent = await fs.readFile(path$3.join(root2, templatePath), "utf8"), { projectId, dataset, readToken = "" } = envData, findAndReplaceVariable = (content, varRegex, value, useQuotes2) => {
26710
- const pattern = varRegex instanceof RegExp ? varRegex : new RegExp(`${varRegex}=.*$`, "m"), match2 = content.match(pattern);
26711
- if (!match2) return content;
26712
- const varName = match2[0].split("=")[0];
26713
- return content.replace(
26714
- new RegExp(`${varName}=.*$`, "m"),
26715
- `${varName}=${useQuotes2 ? `"${value}"` : value}`
26707
+ if (templatePath)
26708
+ try {
26709
+ const templateContent = await fs.readFile(path$3.join(root2, templatePath), "utf8"), { projectId, dataset, readToken = "" } = envData, findAndReplaceVariable = (content, varRegex, value, useQuotes2) => {
26710
+ const varPattern = typeof varRegex == "string" ? varRegex : varRegex.source, pattern = new RegExp(`.*${varPattern}=.*$`, "gm"), matches = content.matchAll(pattern);
26711
+ return Array.from(matches).reduce((updatedContent, match2) => {
26712
+ if (!match2[0]) return updatedContent;
26713
+ const varName = match2[0].split("=")[0].trim();
26714
+ return updatedContent.replace(
26715
+ new RegExp(`${varName}=.*$`, "gm"),
26716
+ `${varName}=${useQuotes2 ? `"${value}"` : value}`
26717
+ );
26718
+ }, content);
26719
+ };
26720
+ let envContent = templateContent;
26721
+ const vars = [
26722
+ { pattern: ENV_VAR.PROJECT_ID, value: projectId },
26723
+ { pattern: ENV_VAR.DATASET, value: dataset },
26724
+ { pattern: ENV_VAR.READ_TOKEN, value: readToken }
26725
+ ], useQuotes = templateContent.includes('="');
26726
+ for (const { pattern, value } of vars)
26727
+ envContent = findAndReplaceVariable(envContent, pattern, value, useQuotes);
26728
+ await fs.writeFile(path$3.join(root2, targetName), envContent);
26729
+ } catch {
26730
+ throw new Error(
26731
+ "Failed to set environment variables. This could be due to file permissions or the .env file format. See https://www.sanity.io/docs/environment-variables for details on environment variable setup."
26716
26732
  );
26717
- };
26718
- let envContent = templateContent;
26719
- const vars = [
26720
- { pattern: ENV_VAR.PROJECT_ID, value: projectId },
26721
- { pattern: ENV_VAR.DATASET, value: dataset },
26722
- { pattern: ENV_VAR.READ_TOKEN, value: readToken }
26723
- ], useQuotes = templateContent.includes('="');
26724
- for (const { pattern, value } of vars)
26725
- envContent = findAndReplaceVariable(envContent, pattern, value, useQuotes);
26726
- await fs.writeFile(path$3.join(root2, targetName), envContent);
26727
- } catch {
26728
- throw new Error(
26729
- "Failed to set environment variables. This could be due to file permissions or the .env file format. See https://www.sanity.io/docs/environment-variables for details on environment variable setup."
26730
- );
26731
- }
26733
+ }
26732
26734
  }
26733
26735
  async function tryApplyPackageName(root2, name) {
26734
26736
  try {
@@ -37707,7 +37709,46 @@ function requireLib$1() {
37707
37709
  }
37708
37710
  return ParseErrorConstructors;
37709
37711
  }
37710
- const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)), {
37712
+ const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
37713
+ function createDefaultOptions() {
37714
+ return {
37715
+ sourceType: "script",
37716
+ sourceFilename: void 0,
37717
+ startIndex: 0,
37718
+ startColumn: 0,
37719
+ startLine: 1,
37720
+ allowAwaitOutsideFunction: !1,
37721
+ allowReturnOutsideFunction: !1,
37722
+ allowNewTargetOutsideFunction: !1,
37723
+ allowImportExportEverywhere: !1,
37724
+ allowSuperOutsideMethod: !1,
37725
+ allowUndeclaredExports: !1,
37726
+ plugins: [],
37727
+ strictMode: null,
37728
+ ranges: !1,
37729
+ tokens: !1,
37730
+ createImportExpressions: !1,
37731
+ createParenthesizedExpressions: !1,
37732
+ errorRecovery: !1,
37733
+ attachComment: !0,
37734
+ annexB: !0
37735
+ };
37736
+ }
37737
+ function getOptions(opts) {
37738
+ const options2 = createDefaultOptions();
37739
+ if (opts == null)
37740
+ return options2;
37741
+ if (opts.annexB != null && opts.annexB !== !1)
37742
+ throw new Error("The `annexB` option can only be set to `false`.");
37743
+ for (const key2 of Object.keys(options2))
37744
+ opts[key2] != null && (options2[key2] = opts[key2]);
37745
+ if (options2.startLine === 1)
37746
+ opts.startIndex == null && options2.startColumn > 0 ? options2.startIndex = options2.startColumn : opts.startColumn == null && options2.startIndex > 0 && (options2.startColumn = options2.startIndex);
37747
+ else if ((opts.startColumn == null || opts.startIndex == null) && opts.startIndex != null)
37748
+ throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
37749
+ return options2;
37750
+ }
37751
+ const {
37711
37752
  defineProperty: defineProperty2
37712
37753
  } = Object, toUnenumerable = (object, key2) => {
37713
37754
  object && defineProperty2(object, key2, {
@@ -37721,7 +37762,7 @@ function requireLib$1() {
37721
37762
  var estree = (superClass) => class extends superClass {
37722
37763
  parse() {
37723
37764
  const file = toESTreeLocation(super.parse());
37724
- return this.options.tokens && (file.tokens = file.tokens.map(toESTreeLocation)), file;
37765
+ return this.optionFlags & 128 && (file.tokens = file.tokens.map(toESTreeLocation)), file;
37725
37766
  }
37726
37767
  parseRegExpLiteral({
37727
37768
  pattern,
@@ -37791,9 +37832,6 @@ function requireLib$1() {
37791
37832
  const directiveStatements = node.directives.map((d) => this.directiveToStmt(d));
37792
37833
  node.body = directiveStatements.concat(node.body), delete node.directives;
37793
37834
  }
37794
- pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
37795
- this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", !0), method.typeParameters && (method.value.typeParameters = method.typeParameters, delete method.typeParameters), classBody.body.push(method);
37796
- }
37797
37835
  parsePrivateName() {
37798
37836
  const node = super.parsePrivateName();
37799
37837
  return this.getPluginOption("estree", "classFeatures") ? this.convertPrivateNameToPrivateIdentifier(node) : node;
@@ -37817,7 +37855,11 @@ function requireLib$1() {
37817
37855
  }
37818
37856
  parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope = !1) {
37819
37857
  let funcNode = this.startNode();
37820
- return funcNode.kind = node.kind, funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope), funcNode.type = "FunctionExpression", delete funcNode.kind, node.value = funcNode, type2 === "ClassPrivateMethod" && (node.computed = !1), this.finishNode(node, "MethodDefinition");
37858
+ funcNode.kind = node.kind, funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope), funcNode.type = "FunctionExpression", delete funcNode.kind, node.value = funcNode;
37859
+ const {
37860
+ typeParameters
37861
+ } = node;
37862
+ return typeParameters && (delete node.typeParameters, funcNode.typeParameters = typeParameters, funcNode.start = typeParameters.start, funcNode.loc.start = typeParameters.loc.start), type2 === "ClassPrivateMethod" && (node.computed = !1), this.finishNode(node, "MethodDefinition");
37821
37863
  }
37822
37864
  nameIsConstructor(key2) {
37823
37865
  return key2.type === "Literal" ? key2.value === "constructor" : super.nameIsConstructor(key2);
@@ -38721,6 +38763,12 @@ function requireLib$1() {
38721
38763
  case "ImportDeclaration":
38722
38764
  adjustInnerComments(node, node.specifiers, commentWS);
38723
38765
  break;
38766
+ case "TSEnumDeclaration":
38767
+ adjustInnerComments(node, node.members, commentWS);
38768
+ break;
38769
+ case "TSEnumBody":
38770
+ adjustInnerComments(node, node.members, commentWS);
38771
+ break;
38724
38772
  default:
38725
38773
  setInnerComments(node, comments2);
38726
38774
  }
@@ -39138,7 +39186,7 @@ function requireLib$1() {
39138
39186
  class Tokenizer extends CommentsParser {
39139
39187
  constructor(options2, input2) {
39140
39188
  super(), this.isLookahead = void 0, this.tokens = [], this.errorHandlers_readInt = {
39141
- invalidDigit: (pos2, lineStart, curLine, radix) => this.options.errorRecovery ? (this.raise(Errors.InvalidDigit, buildPosition(pos2, lineStart, curLine), {
39189
+ invalidDigit: (pos2, lineStart, curLine, radix) => this.optionFlags & 1024 ? (this.raise(Errors.InvalidDigit, buildPosition(pos2, lineStart, curLine), {
39142
39190
  radix
39143
39191
  }), !0) : !1,
39144
39192
  numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
@@ -39164,7 +39212,7 @@ function requireLib$1() {
39164
39212
  this.tokens.length = this.state.tokensLength, this.tokens.push(token2), ++this.state.tokensLength;
39165
39213
  }
39166
39214
  next() {
39167
- this.checkKeywordEscapes(), this.options.tokens && this.pushToken(new Token(this.state)), this.state.lastTokEndLoc = this.state.endLoc, this.state.lastTokStartLoc = this.state.startLoc, this.nextToken();
39215
+ this.checkKeywordEscapes(), this.optionFlags & 128 && this.pushToken(new Token(this.state)), this.state.lastTokEndLoc = this.state.endLoc, this.state.lastTokStartLoc = this.state.startLoc, this.nextToken();
39168
39216
  }
39169
39217
  eat(type2) {
39170
39218
  return this.match(type2) ? (this.next(), !0) : !1;
@@ -39249,7 +39297,7 @@ function requireLib$1() {
39249
39297
  end: this.sourceToOffsetPos(end + commentEnd.length),
39250
39298
  loc: new SourceLocation(startLoc, this.state.curPosition())
39251
39299
  };
39252
- return this.options.tokens && this.pushToken(comment), comment;
39300
+ return this.optionFlags & 128 && this.pushToken(comment), comment;
39253
39301
  }
39254
39302
  skipLineComment(startSkip) {
39255
39303
  const start = this.state.pos;
@@ -39267,10 +39315,10 @@ function requireLib$1() {
39267
39315
  end: this.sourceToOffsetPos(end),
39268
39316
  loc: new SourceLocation(startLoc, this.state.curPosition())
39269
39317
  };
39270
- return this.options.tokens && this.pushToken(comment), comment;
39318
+ return this.optionFlags & 128 && this.pushToken(comment), comment;
39271
39319
  }
39272
39320
  skipSpace() {
39273
- const spaceStart = this.state.pos, comments2 = [];
39321
+ const spaceStart = this.state.pos, comments2 = this.optionFlags & 2048 ? [] : null;
39274
39322
  loop: for (; this.state.pos < this.length; ) {
39275
39323
  const ch = this.input.charCodeAt(this.state.pos);
39276
39324
  switch (ch) {
@@ -39290,12 +39338,12 @@ function requireLib$1() {
39290
39338
  switch (this.input.charCodeAt(this.state.pos + 1)) {
39291
39339
  case 42: {
39292
39340
  const comment = this.skipBlockComment("*/");
39293
- comment !== void 0 && (this.addComment(comment), this.options.attachComment && comments2.push(comment));
39341
+ comment !== void 0 && (this.addComment(comment), comments2?.push(comment));
39294
39342
  break;
39295
39343
  }
39296
39344
  case 47: {
39297
39345
  const comment = this.skipLineComment(2);
39298
- comment !== void 0 && (this.addComment(comment), this.options.attachComment && comments2.push(comment));
39346
+ comment !== void 0 && (this.addComment(comment), comments2?.push(comment));
39299
39347
  break;
39300
39348
  }
39301
39349
  default:
@@ -39305,25 +39353,25 @@ function requireLib$1() {
39305
39353
  default:
39306
39354
  if (isWhitespace(ch))
39307
39355
  ++this.state.pos;
39308
- else if (ch === 45 && !this.inModule && this.options.annexB) {
39356
+ else if (ch === 45 && !this.inModule && this.optionFlags & 4096) {
39309
39357
  const pos2 = this.state.pos;
39310
39358
  if (this.input.charCodeAt(pos2 + 1) === 45 && this.input.charCodeAt(pos2 + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
39311
39359
  const comment = this.skipLineComment(3);
39312
- comment !== void 0 && (this.addComment(comment), this.options.attachComment && comments2.push(comment));
39360
+ comment !== void 0 && (this.addComment(comment), comments2?.push(comment));
39313
39361
  } else
39314
39362
  break loop;
39315
- } else if (ch === 60 && !this.inModule && this.options.annexB) {
39363
+ } else if (ch === 60 && !this.inModule && this.optionFlags & 4096) {
39316
39364
  const pos2 = this.state.pos;
39317
39365
  if (this.input.charCodeAt(pos2 + 1) === 33 && this.input.charCodeAt(pos2 + 2) === 45 && this.input.charCodeAt(pos2 + 3) === 45) {
39318
39366
  const comment = this.skipLineComment(4);
39319
- comment !== void 0 && (this.addComment(comment), this.options.attachComment && comments2.push(comment));
39367
+ comment !== void 0 && (this.addComment(comment), comments2?.push(comment));
39320
39368
  } else
39321
39369
  break loop;
39322
39370
  } else
39323
39371
  break loop;
39324
39372
  }
39325
39373
  }
39326
- if (comments2.length > 0) {
39374
+ if (comments2?.length > 0) {
39327
39375
  const end = this.state.pos, commentWhitespace = {
39328
39376
  start: this.sourceToOffsetPos(spaceStart),
39329
39377
  end: this.sourceToOffsetPos(end),
@@ -39790,7 +39838,7 @@ function requireLib$1() {
39790
39838
  }
39791
39839
  raise(toParseError, at, details = {}) {
39792
39840
  const loc = at instanceof Position ? at : at.loc.start, error2 = toParseError(loc, details);
39793
- if (!this.options.errorRecovery) throw error2;
39841
+ if (!(this.optionFlags & 1024)) throw error2;
39794
39842
  return this.isLookahead || this.state.errors.push(error2), error2;
39795
39843
  }
39796
39844
  raiseOverwrite(toParseError, at, details = {}) {
@@ -40166,7 +40214,7 @@ function requireLib$1() {
40166
40214
  }
40167
40215
  class Node {
40168
40216
  constructor(parser2, pos2, loc) {
40169
- this.type = "", this.start = pos2, this.end = 0, this.loc = new SourceLocation(loc), parser2 != null && parser2.options.ranges && (this.range = [pos2, 0]), parser2 != null && parser2.filename && (this.loc.filename = parser2.filename);
40217
+ this.type = "", this.start = pos2, this.end = 0, this.loc = new SourceLocation(loc), parser2?.optionFlags & 64 && (this.range = [pos2, 0]), parser2 != null && parser2.filename && (this.loc.filename = parser2.filename);
40170
40218
  }
40171
40219
  }
40172
40220
  const NodePrototype = Node.prototype;
@@ -40222,13 +40270,13 @@ function requireLib$1() {
40222
40270
  return this.finishNodeAt(node, type2, this.state.lastTokEndLoc);
40223
40271
  }
40224
40272
  finishNodeAt(node, type2, endLoc) {
40225
- return node.type = type2, node.end = endLoc.index, node.loc.end = endLoc, this.options.ranges && (node.range[1] = endLoc.index), this.options.attachComment && this.processComment(node), node;
40273
+ return node.type = type2, node.end = endLoc.index, node.loc.end = endLoc, this.optionFlags & 64 && (node.range[1] = endLoc.index), this.optionFlags & 2048 && this.processComment(node), node;
40226
40274
  }
40227
40275
  resetStartLocation(node, startLoc) {
40228
- node.start = startLoc.index, node.loc.start = startLoc, this.options.ranges && (node.range[0] = startLoc.index);
40276
+ node.start = startLoc.index, node.loc.start = startLoc, this.optionFlags & 64 && (node.range[0] = startLoc.index);
40229
40277
  }
40230
40278
  resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
40231
- node.end = endLoc.index, node.loc.end = endLoc, this.options.ranges && (node.range[1] = endLoc.index);
40279
+ node.end = endLoc.index, node.loc.end = endLoc, this.optionFlags & 64 && (node.range[1] = endLoc.index);
40232
40280
  }
40233
40281
  resetStartLocationFromNode(node, locationNode) {
40234
40282
  this.resetStartLocation(node, locationNode.loc.start);
@@ -40525,15 +40573,34 @@ function requireLib$1() {
40525
40573
  } while (!this.match(48));
40526
40574
  return this.expect(48), this.state.inType = oldInType, this.finishNode(node, "TypeParameterDeclaration");
40527
40575
  }
40576
+ flowInTopLevelContext(cb) {
40577
+ if (this.curContext() !== types2.brace) {
40578
+ const oldContext = this.state.context;
40579
+ this.state.context = [oldContext[0]];
40580
+ try {
40581
+ return cb();
40582
+ } finally {
40583
+ this.state.context = oldContext;
40584
+ }
40585
+ } else
40586
+ return cb();
40587
+ }
40588
+ flowParseTypeParameterInstantiationInExpression() {
40589
+ if (this.reScan_lt() === 47)
40590
+ return this.flowParseTypeParameterInstantiation();
40591
+ }
40528
40592
  flowParseTypeParameterInstantiation() {
40529
40593
  const node = this.startNode(), oldInType = this.state.inType;
40530
- node.params = [], this.state.inType = !0, this.expect(47);
40531
- const oldNoAnonFunctionType = this.state.noAnonFunctionType;
40532
- for (this.state.noAnonFunctionType = !1; !this.match(48); )
40533
- node.params.push(this.flowParseType()), this.match(48) || this.expect(12);
40534
- return this.state.noAnonFunctionType = oldNoAnonFunctionType, this.expect(48), this.state.inType = oldInType, this.finishNode(node, "TypeParameterInstantiation");
40594
+ return this.state.inType = !0, node.params = [], this.flowInTopLevelContext(() => {
40595
+ this.expect(47);
40596
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
40597
+ for (this.state.noAnonFunctionType = !1; !this.match(48); )
40598
+ node.params.push(this.flowParseType()), this.match(48) || this.expect(12);
40599
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
40600
+ }), this.state.inType = oldInType, !this.state.inType && this.curContext() === types2.brace && this.reScan_lt_gt(), this.expect(48), this.finishNode(node, "TypeParameterInstantiation");
40535
40601
  }
40536
40602
  flowParseTypeParameterInstantiationCallOrNew() {
40603
+ if (this.reScan_lt() !== 47) return;
40537
40604
  const node = this.startNode(), oldInType = this.state.inType;
40538
40605
  for (node.params = [], this.state.inType = !0, this.expect(47); !this.match(48); )
40539
40606
  node.params.push(this.flowParseTypeOrImplicitInstantiation()), this.match(48) || this.expect(12);
@@ -41080,7 +41147,7 @@ function requireLib$1() {
41080
41147
  method.variance && this.unexpected(method.variance.loc.start), delete method.variance, this.match(47) && (method.typeParameters = this.flowParseTypeParameterDeclaration()), super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
41081
41148
  }
41082
41149
  parseClassSuper(node) {
41083
- if (super.parseClassSuper(node), node.superClass && this.match(47) && (node.superTypeParameters = this.flowParseTypeParameterInstantiation()), this.isContextual(113)) {
41150
+ if (super.parseClassSuper(node), node.superClass && (this.match(47) || this.match(51)) && (node.superTypeParameters = this.flowParseTypeParameterInstantiationInExpression()), this.isContextual(113)) {
41084
41151
  this.next();
41085
41152
  const implemented = node.implements = [];
41086
41153
  do {
@@ -41277,8 +41344,8 @@ function requireLib$1() {
41277
41344
  return subscriptState.stop = !0, base2;
41278
41345
  this.next();
41279
41346
  const node = this.startNodeAt(startLoc);
41280
- return node.callee = base2, node.typeArguments = this.flowParseTypeParameterInstantiation(), this.expect(10), node.arguments = this.parseCallExpressionArguments(11), node.optional = !0, this.finishCallExpression(node, !0);
41281
- } else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
41347
+ return node.callee = base2, node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(), this.expect(10), node.arguments = this.parseCallExpressionArguments(11), node.optional = !0, this.finishCallExpression(node, !0);
41348
+ } else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) {
41282
41349
  const node = this.startNodeAt(startLoc);
41283
41350
  node.callee = base2;
41284
41351
  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)));
@@ -41584,6 +41651,9 @@ function requireLib$1() {
41584
41651
  const id = this.parseIdentifier();
41585
41652
  return node.id = id, node.body = this.flowEnumBody(this.startNode(), id), this.finishNode(node, "EnumDeclaration");
41586
41653
  }
41654
+ jsxParseOpeningElementAfterName(node) {
41655
+ return this.shouldParseTypes() && (this.match(47) || this.match(51)) && (node.typeArguments = this.flowParseTypeParameterInstantiationInExpression()), super.jsxParseOpeningElementAfterName(node);
41656
+ }
41587
41657
  isLookaheadToken_lt() {
41588
41658
  const next = this.nextTokenStart();
41589
41659
  if (this.input.charCodeAt(next) === 60) {
@@ -41592,6 +41662,18 @@ function requireLib$1() {
41592
41662
  }
41593
41663
  return !1;
41594
41664
  }
41665
+ reScan_lt_gt() {
41666
+ const {
41667
+ type: type2
41668
+ } = this.state;
41669
+ type2 === 47 ? (this.state.pos -= 1, this.readToken_lt()) : type2 === 48 && (this.state.pos -= 1, this.readToken_gt());
41670
+ }
41671
+ reScan_lt() {
41672
+ const {
41673
+ type: type2
41674
+ } = this.state;
41675
+ return type2 === 51 ? (this.state.pos -= 2, this.finishOp(47, 1), 47) : type2;
41676
+ }
41595
41677
  maybeUnwrapTypeCastExpression(node) {
41596
41678
  return node.type === "TypeCastExpression" ? node.expression : node;
41597
41679
  }
@@ -42695,7 +42777,7 @@ function requireLib$1() {
42695
42777
  }
42696
42778
  tsParseImportType() {
42697
42779
  const node = this.startNode();
42698
- return this.expect(83), this.expect(10), this.match(134) || this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc), node.argument = super.parseExprAtom(), this.eat(12) && !this.match(11) ? (node.options = super.parseMaybeAssignAllowIn(), this.eat(12)) : node.options = null, this.expect(11), this.eat(16) && (node.qualifier = this.tsParseEntityName()), this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSImportType");
42780
+ return this.expect(83), this.expect(10), this.match(134) ? node.argument = this.parseStringLiteral(this.state.value) : (this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc), node.argument = super.parseExprAtom()), this.eat(12) && !this.match(11) ? (node.options = super.parseMaybeAssignAllowIn(), this.eat(12)) : node.options = null, this.expect(11), this.eat(16) && (node.qualifier = this.tsParseEntityName()), this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSImportType");
42699
42781
  }
42700
42782
  tsParseEntityName(allowReservedWords = !0) {
42701
42783
  let entity = this.parseIdentifier(allowReservedWords);
@@ -43127,14 +43209,17 @@ function requireLib$1() {
43127
43209
  return this.tsParseType();
43128
43210
  }), this.semicolon(), this.finishNode(node, "TSTypeAliasDeclaration");
43129
43211
  }
43130
- tsInNoContext(cb) {
43131
- const oldContext = this.state.context;
43132
- this.state.context = [oldContext[0]];
43133
- try {
43212
+ tsInTopLevelContext(cb) {
43213
+ if (this.curContext() !== types2.brace) {
43214
+ const oldContext = this.state.context;
43215
+ this.state.context = [oldContext[0]];
43216
+ try {
43217
+ return cb();
43218
+ } finally {
43219
+ this.state.context = oldContext;
43220
+ }
43221
+ } else
43134
43222
  return cb();
43135
- } finally {
43136
- this.state.context = oldContext;
43137
- }
43138
43223
  }
43139
43224
  tsInType(cb) {
43140
43225
  const oldInType = this.state.inType;
@@ -43180,6 +43265,10 @@ function requireLib$1() {
43180
43265
  tsParseEnumDeclaration(node, properties = {}) {
43181
43266
  return properties.const && (node.const = !0), properties.declare && (node.declare = !0), this.expectContextual(126), node.id = this.parseIdentifier(), this.checkIdentifier(node.id, node.const ? 8971 : 8459), this.expect(5), node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)), this.expect(8), this.finishNode(node, "TSEnumDeclaration");
43182
43267
  }
43268
+ tsParseEnumBody() {
43269
+ const node = this.startNode();
43270
+ return this.expect(5), node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)), this.expect(8), this.finishNode(node, "TSEnumBody");
43271
+ }
43183
43272
  tsParseModuleBlock() {
43184
43273
  const node = this.startNode();
43185
43274
  return this.scope.enter(0), this.expect(5), super.parseBlockOrModuleBlockBody(node.body = [], void 0, !0, 8), this.scope.exit(), this.finishNode(node, "TSModuleBlock");
@@ -43323,7 +43412,7 @@ function requireLib$1() {
43323
43412
  }
43324
43413
  tsParseTypeArguments() {
43325
43414
  const node = this.startNode();
43326
- return node.params = this.tsInType(() => this.tsInNoContext(() => (this.expect(47), this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this))))), node.params.length === 0 ? this.raise(TSErrors.EmptyTypeArguments, node) : !this.state.inType && this.curContext() === types2.brace && this.reScan_lt_gt(), this.expect(48), this.finishNode(node, "TSTypeParameterInstantiation");
43415
+ return node.params = this.tsInType(() => this.tsInTopLevelContext(() => (this.expect(47), this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this))))), node.params.length === 0 ? this.raise(TSErrors.EmptyTypeArguments, node) : !this.state.inType && this.curContext() === types2.brace && this.reScan_lt_gt(), this.expect(48), this.finishNode(node, "TSTypeParameterInstantiation");
43327
43416
  }
43328
43417
  tsIsDeclarationStart() {
43329
43418
  return tokenIsTSDeclarationStart(this.state.type);
@@ -43789,16 +43878,16 @@ function requireLib$1() {
43789
43878
  parseBindingAtom() {
43790
43879
  return this.state.type === 78 ? this.parseIdentifier(!0) : super.parseBindingAtom();
43791
43880
  }
43792
- parseMaybeDecoratorArguments(expr) {
43881
+ parseMaybeDecoratorArguments(expr, startLoc) {
43793
43882
  if (this.match(47) || this.match(51)) {
43794
43883
  const typeArguments = this.tsParseTypeArgumentsInExpression();
43795
43884
  if (this.match(10)) {
43796
- const call = super.parseMaybeDecoratorArguments(expr);
43885
+ const call = super.parseMaybeDecoratorArguments(expr, startLoc);
43797
43886
  return call.typeParameters = typeArguments, call;
43798
43887
  }
43799
43888
  this.unexpected(null, 10);
43800
43889
  }
43801
- return super.parseMaybeDecoratorArguments(expr);
43890
+ return super.parseMaybeDecoratorArguments(expr, startLoc);
43802
43891
  }
43803
43892
  checkCommaAfterRest(close) {
43804
43893
  return this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close ? (this.next(), !1) : super.checkCommaAfterRest(close);
@@ -43904,7 +43993,7 @@ function requireLib$1() {
43904
43993
  }
43905
43994
  parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope) {
43906
43995
  const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope);
43907
- if (method.abstract && (this.hasPlugin("estree") ? !!method.value.body : !!method.body)) {
43996
+ if (method.abstract && (this.hasPlugin("estree") ? method.value : method).body) {
43908
43997
  const {
43909
43998
  key: key2
43910
43999
  } = method;
@@ -44196,44 +44285,6 @@ function requireLib$1() {
44196
44285
  v8intrinsic,
44197
44286
  placeholders
44198
44287
  }, mixinPluginNames = Object.keys(mixinPlugins);
44199
- function createDefaultOptions() {
44200
- return {
44201
- sourceType: "script",
44202
- sourceFilename: void 0,
44203
- startIndex: 0,
44204
- startColumn: 0,
44205
- startLine: 1,
44206
- allowAwaitOutsideFunction: !1,
44207
- allowReturnOutsideFunction: !1,
44208
- allowNewTargetOutsideFunction: !1,
44209
- allowImportExportEverywhere: !1,
44210
- allowSuperOutsideMethod: !1,
44211
- allowUndeclaredExports: !1,
44212
- plugins: [],
44213
- strictMode: null,
44214
- ranges: !1,
44215
- tokens: !1,
44216
- createImportExpressions: !1,
44217
- createParenthesizedExpressions: !1,
44218
- errorRecovery: !1,
44219
- attachComment: !0,
44220
- annexB: !0
44221
- };
44222
- }
44223
- function getOptions(opts) {
44224
- const options2 = createDefaultOptions();
44225
- if (opts == null)
44226
- return options2;
44227
- if (opts.annexB != null && opts.annexB !== !1)
44228
- throw new Error("The `annexB` option can only be set to `false`.");
44229
- for (const key2 of Object.keys(options2))
44230
- opts[key2] != null && (options2[key2] = opts[key2]);
44231
- if (options2.startLine === 1)
44232
- opts.startIndex == null && options2.startColumn > 0 ? options2.startIndex = options2.startColumn : opts.startColumn == null && options2.startIndex > 0 && (options2.startColumn = options2.startIndex);
44233
- else if ((opts.startColumn == null || opts.startIndex == null) && opts.startIndex != null)
44234
- throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
44235
- return options2;
44236
- }
44237
44288
  class ExpressionParser extends LValParser {
44238
44289
  checkProto(prop, isRecord, protoRef, refExpressionErrors) {
44239
44290
  if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand)
@@ -44253,7 +44304,7 @@ function requireLib$1() {
44253
44304
  getExpression() {
44254
44305
  this.enterInitialScopes(), this.nextToken();
44255
44306
  const expr = this.parseExpression();
44256
- return this.match(140) || this.unexpected(), this.finalizeRemainingComments(), expr.comments = this.comments, expr.errors = this.state.errors, this.options.tokens && (expr.tokens = this.tokens), expr;
44307
+ return this.match(140) || this.unexpected(), this.finalizeRemainingComments(), expr.comments = this.comments, expr.errors = this.state.errors, this.optionFlags & 128 && (expr.tokens = this.tokens), expr;
44257
44308
  }
44258
44309
  parseExpression(disallowIn, refExpressionErrors) {
44259
44310
  return disallowIn ? this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)) : this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
@@ -44543,7 +44594,7 @@ function requireLib$1() {
44543
44594
  case 79:
44544
44595
  return this.parseSuper();
44545
44596
  case 83:
44546
- return node = this.startNode(), this.next(), this.match(16) ? this.parseImportMetaProperty(node) : this.match(10) ? this.options.createImportExpressions ? this.parseImportCall(node) : this.finishNode(node, "Import") : (this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc), this.finishNode(node, "Import"));
44597
+ return node = this.startNode(), this.next(), this.match(16) ? this.parseImportMetaProperty(node) : this.match(10) ? this.optionFlags & 256 ? this.parseImportCall(node) : this.finishNode(node, "Import") : (this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc), this.finishNode(node, "Import"));
44547
44598
  case 78:
44548
44599
  return node = this.startNode(), this.next(), this.finishNode(node, "ThisExpression");
44549
44600
  case 90:
@@ -44686,7 +44737,7 @@ function requireLib$1() {
44686
44737
  }
44687
44738
  parseSuper() {
44688
44739
  const node = this.startNode();
44689
- return this.next(), this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod ? this.raise(Errors.SuperNotAllowed, node) : !this.scope.allowSuper && !this.options.allowSuperOutsideMethod && this.raise(Errors.UnexpectedSuper, node), !this.match(10) && !this.match(0) && !this.match(16) && this.raise(Errors.UnsupportedSuper, node), this.finishNode(node, "Super");
44740
+ return this.next(), this.match(10) && !this.scope.allowDirectSuper && !(this.optionFlags & 16) ? this.raise(Errors.SuperNotAllowed, node) : !this.scope.allowSuper && !(this.optionFlags & 16) && this.raise(Errors.UnexpectedSuper, node), !this.match(10) && !this.match(0) && !this.match(16) && this.raise(Errors.UnsupportedSuper, node), this.finishNode(node, "Super");
44690
44741
  }
44691
44742
  parsePrivateName() {
44692
44743
  const node = this.startNode(), id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1)), name = this.state.value;
@@ -44714,7 +44765,7 @@ function requireLib$1() {
44714
44765
  this.inModule || this.raise(Errors.ImportMetaOutsideModule, id), this.sawUnambiguousESM = !0;
44715
44766
  else if (this.isContextual(105) || this.isContextual(97)) {
44716
44767
  const isSource = this.isContextual(105);
44717
- if (isSource || this.unexpected(), this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"), !this.options.createImportExpressions)
44768
+ if (this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"), !(this.optionFlags & 256))
44718
44769
  throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, {
44719
44770
  phase: this.state.value
44720
44771
  });
@@ -44781,7 +44832,7 @@ function requireLib$1() {
44781
44832
  return canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode)) ? (this.checkDestructuringPrivate(refExpressionErrors), this.expressionScope.validateAsPattern(), this.expressionScope.exit(), this.parseArrowExpression(arrowNode, exprList, !1), arrowNode) : (this.expressionScope.exit(), exprList.length || this.unexpected(this.state.lastTokStartLoc), optionalCommaStartLoc && this.unexpected(optionalCommaStartLoc), spreadStartLoc && this.unexpected(spreadStartLoc), this.checkExpressionErrors(refExpressionErrors, !0), this.toReferencedListDeep(exprList, !0), exprList.length > 1 ? (val = this.startNodeAt(innerStartLoc), val.expressions = exprList, this.finishNode(val, "SequenceExpression"), this.resetEndLocation(val, innerEndLoc)) : val = exprList[0], this.wrapParenthesis(startLoc, val));
44782
44833
  }
44783
44834
  wrapParenthesis(startLoc, expression) {
44784
- if (!this.options.createParenthesizedExpressions)
44835
+ if (!(this.optionFlags & 512))
44785
44836
  return this.addExtra(expression, "parenthesized", !0), this.addExtra(expression, "parenStart", startLoc.index), this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index), expression;
44786
44837
  const parenExpression = this.startNodeAt(startLoc);
44787
44838
  return parenExpression.expression = expression, this.finishNode(parenExpression, "ParenthesizedExpression");
@@ -44802,7 +44853,7 @@ function requireLib$1() {
44802
44853
  const meta = this.createIdentifier(this.startNodeAtNode(node), "new");
44803
44854
  this.next();
44804
44855
  const metaProp = this.parseMetaProperty(node, meta, "target");
44805
- return !this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction && this.raise(Errors.UnexpectedNewTarget, metaProp), metaProp;
44856
+ return !this.scope.inNonArrowFunction && !this.scope.inClass && !(this.optionFlags & 4) && this.raise(Errors.UnexpectedNewTarget, metaProp), metaProp;
44806
44857
  }
44807
44858
  return this.parseNew(node);
44808
44859
  }
@@ -45111,12 +45162,12 @@ function requireLib$1() {
45111
45162
  }
45112
45163
  }
45113
45164
  recordAwaitIfAllowed() {
45114
- const isAwaitAllowed = this.prodParam.hasAwait || this.options.allowAwaitOutsideFunction && !this.scope.inFunction;
45165
+ const isAwaitAllowed = this.prodParam.hasAwait || this.optionFlags & 1 && !this.scope.inFunction;
45115
45166
  return isAwaitAllowed && !this.scope.inFunction && (this.state.hasTopLevelAwait = !0), isAwaitAllowed;
45116
45167
  }
45117
45168
  parseAwait(startLoc) {
45118
45169
  const node = this.startNodeAt(startLoc);
45119
- return this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node), this.eat(55) && this.raise(Errors.ObsoleteAwaitStar, node), !this.scope.inFunction && !this.options.allowAwaitOutsideFunction && (this.isAmbiguousAwait() ? this.ambiguousScriptDifferentAst = !0 : this.sawUnambiguousESM = !0), this.state.soloAwait || (node.argument = this.parseMaybeUnary(null, !0)), this.finishNode(node, "AwaitExpression");
45170
+ return this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node), this.eat(55) && this.raise(Errors.ObsoleteAwaitStar, node), !this.scope.inFunction && !(this.optionFlags & 1) && (this.isAmbiguousAwait() ? this.ambiguousScriptDifferentAst = !0 : this.sawUnambiguousESM = !0), this.state.soloAwait || (node.argument = this.parseMaybeUnary(null, !0)), this.finishNode(node, "AwaitExpression");
45120
45171
  }
45121
45172
  isAmbiguousAwait() {
45122
45173
  if (this.hasPrecedingLineBreak()) return !0;
@@ -45372,11 +45423,11 @@ function requireLib$1() {
45372
45423
  }
45373
45424
  class StatementParser extends ExpressionParser {
45374
45425
  parseTopLevel(file, program) {
45375
- return file.program = this.parseProgram(program), file.comments = this.comments, this.options.tokens && (file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex)), this.finishNode(file, "File");
45426
+ return file.program = this.parseProgram(program), file.comments = this.comments, this.optionFlags & 128 && (file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex)), this.finishNode(file, "File");
45376
45427
  }
45377
45428
  parseProgram(program, end = 140, sourceType = this.options.sourceType) {
45378
45429
  if (program.sourceType = sourceType, program.interpreter = this.parseInterpreterDirective(), this.parseBlockBody(program, !0, !0, end), this.inModule) {
45379
- if (!this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0)
45430
+ if (!(this.optionFlags & 32) && this.scope.undefinedExports.size > 0)
45380
45431
  for (const [localName, at] of Array.from(this.scope.undefinedExports))
45381
45432
  this.raise(Errors.ModuleExportUndefined, at, {
45382
45433
  localName
@@ -45522,7 +45573,7 @@ function requireLib$1() {
45522
45573
  break;
45523
45574
  }
45524
45575
  case 82: {
45525
- !this.options.allowImportExportEverywhere && !topLevel && this.raise(Errors.UnexpectedImportExport, this.state.startLoc), this.next();
45576
+ !(this.optionFlags & 8) && !topLevel && this.raise(Errors.UnexpectedImportExport, this.state.startLoc), this.next();
45526
45577
  let result;
45527
45578
  return startType === 83 ? (result = this.parseImport(node), result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value") && (this.sawUnambiguousESM = !0)) : (result = this.parseExport(node, decorators), (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") && (this.sawUnambiguousESM = !0)), this.assertModuleNodeAllowed(result), result;
45528
45579
  }
@@ -45534,13 +45585,17 @@ function requireLib$1() {
45534
45585
  return tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14) ? this.parseLabeledStatement(node, maybeName, expr, flags) : this.parseExpressionStatement(node, expr, decorators);
45535
45586
  }
45536
45587
  assertModuleNodeAllowed(node) {
45537
- !this.options.allowImportExportEverywhere && !this.inModule && this.raise(Errors.ImportOutsideModule, node);
45588
+ !(this.optionFlags & 8) && !this.inModule && this.raise(Errors.ImportOutsideModule, node);
45538
45589
  }
45539
45590
  decoratorsEnabledBeforeExport() {
45540
45591
  return this.hasPlugin("decorators-legacy") ? !0 : this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== !1;
45541
45592
  }
45542
45593
  maybeTakeDecorators(maybeDecorators, classNode, exportNode) {
45543
- return maybeDecorators && (classNode.decorators && classNode.decorators.length > 0 ? (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") != "boolean" && this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]), classNode.decorators.unshift(...maybeDecorators)) : classNode.decorators = maybeDecorators, this.resetStartLocationFromNode(classNode, maybeDecorators[0]), exportNode && this.resetStartLocationFromNode(exportNode, classNode)), classNode;
45594
+ if (maybeDecorators) {
45595
+ var _classNode$decorators;
45596
+ (_classNode$decorators = classNode.decorators) != null && _classNode$decorators.length ? (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") != "boolean" && this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]), classNode.decorators.unshift(...maybeDecorators)) : classNode.decorators = maybeDecorators, this.resetStartLocationFromNode(classNode, maybeDecorators[0]), exportNode && this.resetStartLocationFromNode(exportNode, classNode);
45597
+ }
45598
+ return classNode;
45544
45599
  }
45545
45600
  canHaveLeadingDecorator() {
45546
45601
  return this.match(80);
@@ -45566,21 +45621,21 @@ function requireLib$1() {
45566
45621
  const startLoc2 = this.state.startLoc;
45567
45622
  this.next(), expr = this.parseExpression(), this.expect(11), expr = this.wrapParenthesis(startLoc2, expr);
45568
45623
  const paramsStartLoc = this.state.startLoc;
45569
- node.expression = this.parseMaybeDecoratorArguments(expr), this.getPluginOption("decorators", "allowCallParenthesized") === !1 && node.expression !== expr && this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
45624
+ node.expression = this.parseMaybeDecoratorArguments(expr, startLoc2), this.getPluginOption("decorators", "allowCallParenthesized") === !1 && node.expression !== expr && this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
45570
45625
  } else {
45571
45626
  for (expr = this.parseIdentifier(!1); this.eat(16); ) {
45572
45627
  const node2 = this.startNodeAt(startLoc);
45573
45628
  node2.object = expr, this.match(139) ? (this.classScope.usePrivateName(this.state.value, this.state.startLoc), node2.property = this.parsePrivateName()) : node2.property = this.parseIdentifier(!0), node2.computed = !1, expr = this.finishNode(node2, "MemberExpression");
45574
45629
  }
45575
- node.expression = this.parseMaybeDecoratorArguments(expr);
45630
+ node.expression = this.parseMaybeDecoratorArguments(expr, startLoc);
45576
45631
  }
45577
45632
  } else
45578
45633
  node.expression = this.parseExprSubscripts();
45579
45634
  return this.finishNode(node, "Decorator");
45580
45635
  }
45581
- parseMaybeDecoratorArguments(expr) {
45636
+ parseMaybeDecoratorArguments(expr, startLoc) {
45582
45637
  if (this.eat(10)) {
45583
- const node = this.startNodeAtNode(expr);
45638
+ const node = this.startNodeAt(startLoc);
45584
45639
  return node.callee = expr, node.arguments = this.parseCallExpressionArguments(11), this.toReferencedList(node.arguments), this.finishNode(node, "CallExpression");
45585
45640
  }
45586
45641
  return expr;
@@ -45647,7 +45702,7 @@ function requireLib$1() {
45647
45702
  return this.next(), node.test = this.parseHeaderExpression(), node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(), node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null, this.finishNode(node, "IfStatement");
45648
45703
  }
45649
45704
  parseReturnStatement(node) {
45650
- return !this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction && this.raise(Errors.IllegalReturn, this.state.startLoc), this.next(), this.isLineTerminator() ? node.argument = null : (node.argument = this.parseExpression(), this.semicolon()), this.finishNode(node, "ReturnStatement");
45705
+ 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");
45651
45706
  }
45652
45707
  parseSwitchStatement(node) {
45653
45708
  this.next(), node.discriminant = this.parseHeaderExpression();
@@ -46334,6 +46389,8 @@ function requireLib$1() {
46334
46389
  class Parser extends StatementParser {
46335
46390
  constructor(options2, input2, pluginsMap) {
46336
46391
  options2 = getOptions(options2), super(options2, input2), this.options = options2, this.initializeScopes(), this.plugins = pluginsMap, this.filename = options2.sourceFilename, this.startIndex = options2.startIndex;
46392
+ let optionFlags = 0;
46393
+ options2.allowAwaitOutsideFunction && (optionFlags |= 1), options2.allowReturnOutsideFunction && (optionFlags |= 2), options2.allowImportExportEverywhere && (optionFlags |= 8), options2.allowSuperOutsideMethod && (optionFlags |= 16), options2.allowUndeclaredExports && (optionFlags |= 32), options2.allowNewTargetOutsideFunction && (optionFlags |= 4), options2.ranges && (optionFlags |= 64), options2.tokens && (optionFlags |= 128), options2.createImportExpressions && (optionFlags |= 256), options2.createParenthesizedExpressions && (optionFlags |= 512), options2.errorRecovery && (optionFlags |= 1024), options2.attachComment && (optionFlags |= 2048), options2.annexB && (optionFlags |= 4096), this.optionFlags = optionFlags;
46337
46394
  }
46338
46395
  getScopeHandler() {
46339
46396
  return ScopeHandler;