@putout/babel 4.5.7 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/index.js CHANGED
@@ -8869,12 +8869,8 @@ defineType$4('NumericLiteral', {
8869
8869
  if (1 / val < 0 || !Number.isFinite(val)) {
8870
8870
  const error = new Error(`NumericLiterals must be non-negative finite numbers. You can use t.valueToNode(${val}) instead.`);
8871
8871
 
8872
- {
8873
- {
8874
- if (!new Error().stack.includes('regenerator')) {
8875
- throw error;
8876
- }
8877
- }
8872
+ if (!new Error().stack.includes('regenerator')) {
8873
+ throw error;
8878
8874
  }
8879
8875
  }
8880
8876
  }, {
@@ -9669,11 +9665,6 @@ var importAttributes = {
9669
9665
  optional: true,
9670
9666
  validate: arrayOfType('ImportAttribute'),
9671
9667
  },
9672
- assertions: {
9673
- deprecated: true,
9674
- optional: true,
9675
- validate: arrayOfType('ImportAttribute'),
9676
- },
9677
9668
  };
9678
9669
 
9679
9670
  defineType$4('ExportAllDeclaration', {
@@ -11820,24 +11811,22 @@ defineType('TSLiteralType', {
11820
11811
  },
11821
11812
  },
11822
11813
  });
11823
- {
11824
- defineType('TSClassImplements', {
11825
- aliases: ['TSType'],
11826
- visitor: ['expression', 'typeArguments'],
11827
- fields: {
11828
- expression: validateType('Expression'),
11829
- typeArguments: validateOptionalType('TSTypeParameterInstantiation'),
11830
- },
11831
- });
11832
- defineType('TSInterfaceHeritage', {
11833
- aliases: ['TSType'],
11834
- visitor: ['expression', 'typeArguments'],
11835
- fields: {
11836
- expression: validateType('Expression'),
11837
- typeArguments: validateOptionalType('TSTypeParameterInstantiation'),
11838
- },
11839
- });
11840
- }
11814
+ defineType('TSClassImplements', {
11815
+ aliases: ['TSType'],
11816
+ visitor: ['expression', 'typeArguments'],
11817
+ fields: {
11818
+ expression: validateType('Expression'),
11819
+ typeArguments: validateOptionalType('TSTypeParameterInstantiation'),
11820
+ },
11821
+ });
11822
+ defineType('TSInterfaceHeritage', {
11823
+ aliases: ['TSType'],
11824
+ visitor: ['expression', 'typeArguments'],
11825
+ fields: {
11826
+ expression: validateType('Expression'),
11827
+ typeArguments: validateOptionalType('TSTypeParameterInstantiation'),
11828
+ },
11829
+ });
11841
11830
  defineType('TSInterfaceDeclaration', {
11842
11831
  aliases: ['Statement', 'Declaration'],
11843
11832
  visitor: [
@@ -11915,18 +11904,16 @@ defineType('TSEnumBody', {
11915
11904
  members: validateArrayOfType('TSEnumMember'),
11916
11905
  },
11917
11906
  });
11918
- {
11919
- defineType('TSEnumDeclaration', {
11920
- aliases: ['Statement', 'Declaration'],
11921
- visitor: ['id', 'body'],
11922
- fields: {
11923
- declare: validateOptional(bool),
11924
- const: validateOptional(bool),
11925
- id: validateType('Identifier'),
11926
- body: validateType('TSEnumBody'),
11927
- },
11928
- });
11929
- }
11907
+ defineType('TSEnumDeclaration', {
11908
+ aliases: ['Statement', 'Declaration'],
11909
+ visitor: ['id', 'body'],
11910
+ fields: {
11911
+ declare: validateOptional(bool),
11912
+ const: validateOptional(bool),
11913
+ id: validateType('Identifier'),
11914
+ body: validateType('TSEnumBody'),
11915
+ },
11916
+ });
11930
11917
  defineType('TSEnumMember', {
11931
11918
  visitor: ['id', 'initializer'],
11932
11919
  fields: {
@@ -11962,25 +11949,28 @@ defineType('TSModuleBlock', {
11962
11949
  defineType('TSImportType', {
11963
11950
  aliases: ['TSType'],
11964
11951
  builder: [
11965
- 'argument',
11952
+ 'source',
11966
11953
  'qualifier',
11967
11954
  'typeArguments',
11968
11955
  ],
11969
11956
  visitor: [
11970
- 'argument',
11957
+ 'source',
11971
11958
  'options',
11972
11959
  'qualifier',
11973
11960
  'typeArguments',
11974
11961
  ],
11975
- fields: {
11976
- argument: validateType('TSLiteralType'),
11962
+ fields: Object.assign({}, {
11963
+ source: validateType('StringLiteral'),
11964
+ }, {
11977
11965
  qualifier: validateOptionalType('TSEntityName'),
11978
- ['typeArguments']: validateOptionalType('TSTypeParameterInstantiation'),
11966
+ }, {
11967
+ typeArguments: validateOptionalType('TSTypeParameterInstantiation'),
11968
+ }, {
11979
11969
  options: {
11980
11970
  validate: assertNodeType('ObjectExpression'),
11981
11971
  optional: true,
11982
11972
  },
11983
- },
11973
+ }),
11984
11974
  });
11985
11975
  defineType('TSImportEqualsDeclaration', {
11986
11976
  aliases: ['Statement', 'Declaration'],
@@ -12915,6 +12905,7 @@ function exportAllDeclaration(source) {
12915
12905
  const node = {
12916
12906
  type: 'ExportAllDeclaration',
12917
12907
  source,
12908
+ assertions: null,
12918
12909
  };
12919
12910
 
12920
12911
  const defs = NODE_FIELDS.ExportAllDeclaration;
@@ -15088,16 +15079,16 @@ function tsModuleBlock(body) {
15088
15079
  return node;
15089
15080
  }
15090
15081
 
15091
- function tsImportType(argument, qualifier = null, typeArguments = null) {
15082
+ function tsImportType(source, qualifier = null, typeArguments = null) {
15092
15083
  const node = {
15093
15084
  type: 'TSImportType',
15094
- argument,
15085
+ source,
15095
15086
  qualifier,
15096
15087
  typeArguments,
15097
15088
  };
15098
15089
 
15099
15090
  const defs = NODE_FIELDS.TSImportType;
15100
- validate(defs.argument, node, 'argument', argument, 1);
15091
+ validate(defs.source, node, 'source', source, 1);
15101
15092
  validate(defs.qualifier, node, 'qualifier', qualifier, 1);
15102
15093
  validate(defs.typeArguments, node, 'typeArguments', typeArguments, 1);
15103
15094
  return node;
@@ -15487,12 +15478,10 @@ var b = /* @__PURE__ */Object.freeze({
15487
15478
  });
15488
15479
 
15489
15480
  function alias(lowercase) {
15490
- {
15491
- return function() {
15492
- deprecationWarning(lowercase.replace(/^(?:ts|jsx|[a-z])/, (x) => x.toUpperCase()), lowercase, 'Usage of builders starting with an uppercase letter such as ', 'uppercase builders');
15493
- return b[lowercase](...arguments);
15494
- };
15495
- }
15481
+ return function() {
15482
+ deprecationWarning(lowercase.replace(/^(?:ts|jsx|[a-z])/, (x) => x.toUpperCase()), lowercase, 'Usage of builders starting with an uppercase letter such as ', 'uppercase builders');
15483
+ return b[lowercase](...arguments);
15484
+ };
15496
15485
  }
15497
15486
 
15498
15487
  var ArrayExpression = alias('arrayExpression');
@@ -18204,9 +18193,7 @@ function isBinding(node, parent, grandparent) {
18204
18193
  }
18205
18194
 
18206
18195
  function isLet(node) {
18207
- {
18208
- return isVariableDeclaration(node) && node.kind !== 'var';
18209
- }
18196
+ return isVariableDeclaration(node) && node.kind !== 'var';
18210
18197
  }
18211
18198
 
18212
18199
  function isBlockScoped(node) {
@@ -18462,9 +18449,7 @@ function isValidES3Identifier(name) {
18462
18449
  }
18463
18450
 
18464
18451
  function isVar(node) {
18465
- {
18466
- return isVariableDeclaration(node) && node.kind === 'var';
18467
- }
18452
+ return isVariableDeclaration(node) && node.kind === 'var';
18468
18453
  }
18469
18454
 
18470
18455
  var react = {
@@ -18896,9 +18881,7 @@ function getOptions(opts) {
18896
18881
  options.startColumn = options.startIndex;
18897
18882
  }
18898
18883
  } else if (opts.startColumn == null || opts.startIndex == null) {
18899
- {
18900
- throw new Error('With a `startLine > 1` you must also specify `startIndex` and `startColumn`.');
18901
- }
18884
+ throw new Error('With a `startLine > 1` you must also specify `startIndex` and `startColumn`.');
18902
18885
  }
18903
18886
 
18904
18887
  if (options.sourceType === 'commonjs') {
@@ -21705,12 +21688,11 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
21705
21688
  break;
21706
21689
 
21707
21690
  case 62:
21708
- case 125: {
21691
+ case 125:
21709
21692
  this.raise(JsxErrors.UnexpectedToken, this.state.curPosition(), {
21710
21693
  unexpected: this.input[this.state.pos],
21711
21694
  HTMLEntity: ch === 125 ? '&rbrace;' : '&gt;',
21712
21695
  });
21713
- }
21714
21696
 
21715
21697
  default:
21716
21698
  if (isNewLine(ch)) {
@@ -21916,11 +21898,10 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
21916
21898
  } else {
21917
21899
  const expression2 = this.parseExpression();
21918
21900
 
21919
- {
21920
- if (expression2.type === 'SequenceExpression' && !expression2.extra?.parenthesized) {
21921
- this.raise(JsxErrors.UnexpectedSequenceExpression, expression2.expressions[1]);
21922
- }
21901
+ if (expression2.type === 'SequenceExpression' && !expression2.extra?.parenthesized) {
21902
+ this.raise(JsxErrors.UnexpectedSequenceExpression, expression2.expressions[1]);
21923
21903
  }
21904
+
21924
21905
  node.expression = expression2;
21925
21906
  }
21926
21907
 
@@ -22490,8 +22471,7 @@ var CommentsParser = class extends BaseParser {
22490
22471
  if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) {
22491
22472
  switch(node.type) {
22492
22473
  case 'ObjectExpression':
22493
- case 'ObjectPattern':
22494
- case 'RecordExpression':
22474
+ case 'ObjectPattern':
22495
22475
  adjustInnerComments(node, node.properties, commentWS);
22496
22476
  break;
22497
22477
 
@@ -22514,8 +22494,7 @@ var CommentsParser = class extends BaseParser {
22514
22494
  break;
22515
22495
 
22516
22496
  case 'ArrayExpression':
22517
- case 'ArrayPattern':
22518
- case 'TupleExpression':
22497
+ case 'ArrayPattern':
22519
22498
  adjustInnerComments(node, node.elements, commentWS);
22520
22499
  break;
22521
22500
 
@@ -22524,10 +22503,9 @@ var CommentsParser = class extends BaseParser {
22524
22503
  adjustInnerComments(node, node.specifiers, commentWS);
22525
22504
  break;
22526
22505
 
22527
- case 'TSEnumDeclaration': {
22506
+ case 'TSEnumDeclaration':
22528
22507
  setInnerComments(node, comments);
22529
- }
22530
- break;
22508
+ break;
22531
22509
 
22532
22510
  case 'TSEnumBody':
22533
22511
  adjustInnerComments(node, node.members, commentWS);
@@ -23840,24 +23818,20 @@ var Tokenizer = class extends CommentsParser {
23840
23818
  this.finishToken(12);
23841
23819
  return;
23842
23820
 
23843
- case 91: {
23821
+ case 91:
23844
23822
  ++this.state.pos;
23845
23823
  this.finishToken(0);
23846
- }
23847
-
23848
- return;
23824
+ return;
23849
23825
 
23850
23826
  case 93:
23851
23827
  ++this.state.pos;
23852
23828
  this.finishToken(3);
23853
23829
  return;
23854
23830
 
23855
- case 123: {
23831
+ case 123:
23856
23832
  ++this.state.pos;
23857
23833
  this.finishToken(5);
23858
- }
23859
-
23860
- return;
23834
+ return;
23861
23835
 
23862
23836
  case 125:
23863
23837
  ++this.state.pos;
@@ -24899,11 +24873,10 @@ var UtilParser = class extends Tokenizer {
24899
24873
  scopeFlags |= 512;
24900
24874
  }
24901
24875
 
24902
- {
24903
- if (this.optionFlags & 16) {
24904
- scopeFlags |= 16 | 32;
24905
- }
24876
+ if (this.optionFlags & 16) {
24877
+ scopeFlags |= 16 | 32;
24906
24878
  }
24879
+
24907
24880
  this.scope.enter(scopeFlags);
24908
24881
  }
24909
24882
 
@@ -26009,13 +25982,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
26009
25982
 
26010
25983
  if (!this.match(134)) {
26011
25984
  this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
26012
- {
26013
- node.argument = this.tsParseNonConditionalType();
26014
- }
25985
+ node.source = this.tsParseNonConditionalType();
26015
25986
  } else {
26016
- {
26017
- node.argument = this.tsParseLiteralTypeNode();
26018
- }
25987
+ node.source = this.parseStringLiteral(this.state.value);
26019
25988
  }
26020
25989
 
26021
25990
  if (this.eat(12)) {
@@ -26031,9 +26000,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
26031
26000
  }
26032
26001
 
26033
26002
  if (this.match(47)) {
26034
- {
26035
- node.typeArguments = this.tsParseTypeArguments();
26036
- }
26003
+ node.typeArguments = this.tsParseTypeArguments();
26037
26004
  }
26038
26005
 
26039
26006
  return this.finishNode(node, 'TSImportType');
@@ -26116,9 +26083,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
26116
26083
  node.typeName = this.tsParseEntityName(1);
26117
26084
 
26118
26085
  if (!this.hasPrecedingLineBreak() && this.match(47)) {
26119
- {
26120
- node.typeArguments = this.tsParseTypeArguments();
26121
- }
26086
+ node.typeArguments = this.tsParseTypeArguments();
26122
26087
  }
26123
26088
 
26124
26089
  return this.finishNode(node, 'TSTypeReference');
@@ -26147,15 +26112,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
26147
26112
  if (this.match(83)) {
26148
26113
  node.exprName = this.tsParseImportType();
26149
26114
  } else {
26150
- {
26151
- node.exprName = this.tsParseEntityName(1);
26152
- }
26115
+ node.exprName = this.tsParseEntityName(1);
26153
26116
  }
26154
26117
 
26155
26118
  if (!this.hasPrecedingLineBreak() && this.match(47)) {
26156
- {
26157
- node.typeArguments = this.tsParseTypeArguments();
26158
- }
26119
+ node.typeArguments = this.tsParseTypeArguments();
26159
26120
  }
26160
26121
 
26161
26122
  return this.finishNode(node, 'TSTypeQuery');
@@ -26455,10 +26416,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
26455
26416
  }
26456
26417
 
26457
26418
  this.expect(0);
26458
- {
26459
- node.key = this.tsParseTypeParameterName();
26460
- node.constraint = this.tsExpectThenParseType(58);
26461
- }
26419
+ node.key = this.tsParseTypeParameterName();
26420
+ node.constraint = this.tsExpectThenParseType(58);
26462
26421
  node.nameType = this.eatContextual(93) ? this.tsParseType() : null;
26463
26422
  this.expect(3);
26464
26423
 
@@ -26618,34 +26577,32 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
26618
26577
  }
26619
26578
 
26620
26579
  tsParseTemplateLiteralType() {
26621
- {
26622
- const startLoc = this.state.startLoc;
26623
- let curElt = this.parseTemplateElement(false);
26624
- const quasis = [curElt];
26580
+ const startLoc = this.state.startLoc;
26581
+ let curElt = this.parseTemplateElement(false);
26582
+ const quasis = [curElt];
26583
+
26584
+ if (curElt.tail) {
26585
+ const node = this.startNodeAt(startLoc);
26586
+ const literal = this.startNodeAt(startLoc);
26625
26587
 
26626
- if (curElt.tail) {
26627
- const node = this.startNodeAt(startLoc);
26628
- const literal = this.startNodeAt(startLoc);
26629
-
26630
- literal.expressions = [];
26631
- literal.quasis = quasis;
26632
- node.literal = this.finishNode(literal, 'TemplateLiteral');
26633
- return this.finishNode(node, 'TSLiteralType');
26634
- } else {
26635
- const substitutions = [];
26636
-
26637
- while (!curElt.tail) {
26638
- substitutions.push(this.tsParseType());
26639
- this.readTemplateContinuation();
26640
- quasis.push(curElt = this.parseTemplateElement(false));
26641
- }
26642
-
26643
- const node = this.startNodeAt(startLoc);
26644
-
26645
- node.types = substitutions;
26646
- node.quasis = quasis;
26647
- return this.finishNode(node, 'TSTemplateLiteralType');
26588
+ literal.expressions = [];
26589
+ literal.quasis = quasis;
26590
+ node.literal = this.finishNode(literal, 'TemplateLiteral');
26591
+ return this.finishNode(node, 'TSLiteralType');
26592
+ } else {
26593
+ const substitutions = [];
26594
+
26595
+ while (!curElt.tail) {
26596
+ substitutions.push(this.tsParseType());
26597
+ this.readTemplateContinuation();
26598
+ quasis.push(curElt = this.parseTemplateElement(false));
26648
26599
  }
26600
+
26601
+ const node = this.startNodeAt(startLoc);
26602
+
26603
+ node.types = substitutions;
26604
+ node.quasis = quasis;
26605
+ return this.finishNode(node, 'TSTemplateLiteralType');
26649
26606
  }
26650
26607
  }
26651
26608
 
@@ -26705,7 +26662,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
26705
26662
  case 0:
26706
26663
  return this.tsParseTupleType();
26707
26664
 
26708
- case 10: {
26665
+ case 10:
26709
26666
  if (!(this.optionFlags & 1024)) {
26710
26667
  const startLoc = this.state.startLoc;
26711
26668
  this.next();
@@ -26715,9 +26672,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
26715
26672
  this.addExtra(type, 'parenStart', startLoc.index);
26716
26673
  return type;
26717
26674
  }
26718
- }
26719
-
26720
- return this.tsParseParenthesizedType();
26675
+
26676
+ return this.tsParseParenthesizedType();
26721
26677
 
26722
26678
  case 25:
26723
26679
  case 24:
@@ -27071,32 +27027,30 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27071
27027
  tsParseHeritageClause(token) {
27072
27028
  const originalStartLoc = this.state.startLoc;
27073
27029
  const delimitedList = this.tsParseDelimitedList('HeritageClauseElement', () => {
27074
- {
27075
- const expression2 = super.parseExprSubscripts();
27076
-
27077
- if (!tsIsEntityName(expression2)) {
27078
- this.raise(TSErrors.InvalidHeritageClauseType, expression2.loc.start, {
27079
- token,
27080
- });
27081
- }
27082
-
27083
- const nodeType = token === 'extends' ? 'TSInterfaceHeritage' : 'TSClassImplements';
27084
-
27085
- if (expression2.type === 'TSInstantiationExpression') {
27086
- expression2.type = nodeType;
27087
- return expression2;
27088
- }
27089
-
27090
- const node = this.startNodeAtNode(expression2);
27091
-
27092
- node.expression = expression2;
27093
-
27094
- if (this.match(47) || this.match(51)) {
27095
- node.typeArguments = this.tsParseTypeArgumentsInExpression();
27096
- }
27097
-
27098
- return this.finishNode(node, nodeType);
27030
+ const expression2 = super.parseExprSubscripts();
27031
+
27032
+ if (!tsIsEntityName(expression2)) {
27033
+ this.raise(TSErrors.InvalidHeritageClauseType, expression2.loc.start, {
27034
+ token,
27035
+ });
27036
+ }
27037
+
27038
+ const nodeType = token === 'extends' ? 'TSInterfaceHeritage' : 'TSClassImplements';
27039
+
27040
+ if (expression2.type === 'TSInstantiationExpression') {
27041
+ expression2.type = nodeType;
27042
+ return expression2;
27099
27043
  }
27044
+
27045
+ const node = this.startNodeAtNode(expression2);
27046
+
27047
+ node.expression = expression2;
27048
+
27049
+ if (this.match(47) || this.match(51)) {
27050
+ node.typeArguments = this.tsParseTypeArgumentsInExpression();
27051
+ }
27052
+
27053
+ return this.finishNode(node, nodeType);
27100
27054
  });
27101
27055
 
27102
27056
  if (!delimitedList.length) {
@@ -27247,10 +27201,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27247
27201
  this.expectContextual(126);
27248
27202
  node.id = this.parseIdentifier();
27249
27203
  this.checkIdentifier(node.id, node.const ? 8971 : 8459);
27250
- {
27251
- node.body = this.tsParseEnumBody();
27252
- }
27253
-
27204
+ node.body = this.tsParseEnumBody();
27254
27205
  return this.finishNode(node, 'TSEnumDeclaration');
27255
27206
  }
27256
27207
 
@@ -27278,14 +27229,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27278
27229
  this.checkIdentifier(node.id, 1024);
27279
27230
  }
27280
27231
 
27281
- {
27282
- this.scope.enter(1024);
27283
- this.prodParam.enter(0);
27284
- node.body = this.tsParseModuleBlock();
27285
- this.prodParam.exit();
27286
- this.scope.exit();
27287
- }
27288
-
27232
+ this.scope.enter(1024);
27233
+ this.prodParam.enter(0);
27234
+ node.body = this.tsParseModuleBlock();
27235
+ this.prodParam.exit();
27236
+ this.scope.exit();
27289
27237
  return this.finishNode(node, 'TSModuleDeclaration');
27290
27238
  }
27291
27239
 
@@ -27755,10 +27703,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27755
27703
  if (tokenIsTemplate(this.state.type)) {
27756
27704
  const result2 = super.parseTaggedTemplateExpression(base, startLoc, state);
27757
27705
 
27758
- {
27759
- result2.typeArguments = typeArguments;
27760
- }
27761
-
27706
+ result2.typeArguments = typeArguments;
27762
27707
  return result2;
27763
27708
  }
27764
27709
 
@@ -27768,9 +27713,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27768
27713
  node2.callee = base;
27769
27714
  node2.arguments = this.parseCallExpressionArguments();
27770
27715
  this.tsCheckForInvalidTypeCasts(node2.arguments);
27771
- {
27772
- node2.typeArguments = typeArguments;
27773
- }
27716
+ node2.typeArguments = typeArguments;
27717
+
27774
27718
  if (state.optionalChainMember) {
27775
27719
  node2.optional = isOptionalCall;
27776
27720
  }
@@ -27787,10 +27731,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27787
27731
  const node = this.startNodeAt(startLoc);
27788
27732
 
27789
27733
  node.expression = base;
27790
- {
27791
- node.typeArguments = typeArguments;
27792
- }
27793
-
27734
+ node.typeArguments = typeArguments;
27794
27735
  return this.finishNode(node, 'TSInstantiationExpression');
27795
27736
  });
27796
27737
 
@@ -27821,9 +27762,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27821
27762
  const {callee} = node;
27822
27763
 
27823
27764
  if (callee.type === 'TSInstantiationExpression' && !callee.extra?.parenthesized) {
27824
- {
27825
- node.typeArguments = callee.typeArguments;
27826
- }
27765
+ node.typeArguments = callee.typeArguments;
27827
27766
  node.callee = callee.expression;
27828
27767
  }
27829
27768
  }
@@ -27940,14 +27879,12 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27940
27879
 
27941
27880
  const declaration = this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true);
27942
27881
 
27943
- {
27944
- node.attributes = [];
27945
- node.declaration = declaration;
27946
- node.exportKind = 'value';
27947
- node.source = null;
27948
- node.specifiers = [];
27949
- return this.finishNode(node, 'ExportNamedDeclaration');
27950
- }
27882
+ node.attributes = [];
27883
+ node.declaration = declaration;
27884
+ node.exportKind = 'value';
27885
+ node.source = null;
27886
+ node.specifiers = [];
27887
+ return this.finishNode(node, 'ExportNamedDeclaration');
27951
27888
  } else if (this.eat(29)) {
27952
27889
  const assign = node;
27953
27890
 
@@ -28413,9 +28350,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
28413
28350
  super.parseClassSuper(node);
28414
28351
 
28415
28352
  if (node.superClass && (this.match(47) || this.match(51))) {
28416
- {
28417
- node.superTypeArguments = this.tsParseTypeArgumentsInExpression();
28418
- }
28353
+ node.superTypeArguments = this.tsParseTypeArgumentsInExpression();
28419
28354
  }
28420
28355
 
28421
28356
  if (this.eatContextual(113)) {
@@ -28507,15 +28442,14 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
28507
28442
  }
28508
28443
 
28509
28444
  expr.typeParameters = typeParameters;
28510
- {
28511
- if (this.hasPlugin('jsx') && expr.typeParameters.params.length === 1 && !expr.typeParameters.extra?.trailingComma) {
28512
- const parameter = expr.typeParameters.params[0];
28513
-
28514
- if (!parameter.constraint) {
28515
- this.raise(TSErrors.SingleTypeParameterWithoutTrailingComma, createPositionWithColumnOffset(parameter.loc.end, 1), {
28516
- typeParameterName: parameter.name.name,
28517
- });
28518
- }
28445
+
28446
+ if (this.hasPlugin('jsx') && expr.typeParameters.params.length === 1 && !expr.typeParameters.extra?.trailingComma) {
28447
+ const parameter = expr.typeParameters.params[0];
28448
+
28449
+ if (!parameter.constraint) {
28450
+ this.raise(TSErrors.SingleTypeParameterWithoutTrailingComma, createPositionWithColumnOffset(parameter.loc.end, 1), {
28451
+ typeParameterName: parameter.name.name,
28452
+ });
28519
28453
  }
28520
28454
  }
28521
28455
 
@@ -28722,10 +28656,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
28722
28656
  if (this.match(10)) {
28723
28657
  const call2 = super.parseMaybeDecoratorArguments(expr, startLoc);
28724
28658
 
28725
- {
28726
- call2.typeArguments = typeArguments;
28727
- }
28728
-
28659
+ call2.typeArguments = typeArguments;
28729
28660
  return call2;
28730
28661
  }
28731
28662
 
@@ -28839,9 +28770,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
28839
28770
  const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression());
28840
28771
 
28841
28772
  if (typeArguments) {
28842
- {
28843
- node.typeArguments = typeArguments;
28844
- }
28773
+ node.typeArguments = typeArguments;
28845
28774
  }
28846
28775
  }
28847
28776
 
@@ -29148,10 +29077,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
29148
29077
  case 'TSImportType':
29149
29078
  node.qualifier ?? (node.qualifier = null);
29150
29079
  node.options ?? (node.options = null);
29151
- {
29152
- node.typeArguments ?? (node.typeArguments = null);
29153
- }
29154
-
29080
+ node.typeArguments ?? (node.typeArguments = null);
29155
29081
  return;
29156
29082
 
29157
29083
  case 'TSInterfaceDeclaration':
@@ -29649,27 +29575,21 @@ function validatePlugins(pluginsMap) {
29649
29575
  }
29650
29576
 
29651
29577
  if (pluginsMap.has('moduleAttributes')) {
29652
- {
29653
- throw new Error('`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.');
29654
- }
29578
+ throw new Error('`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.');
29655
29579
  }
29656
29580
 
29657
29581
  if (pluginsMap.has('importAssertions')) {
29658
- {
29659
- throw new Error('`importAssertions` has been removed in Babel 8, please use import attributes instead. To use the non-standard `assert` syntax you can enable the `deprecatedImportAssert` parser plugin.');
29660
- }
29582
+ throw new Error('`importAssertions` has been removed in Babel 8, please use import attributes instead.');
29661
29583
  }
29662
29584
 
29663
- if (!pluginsMap.has('deprecatedImportAssert') && pluginsMap.has('importAttributes') && pluginsMap.get('importAttributes').deprecatedAssertSyntax) {
29664
- {
29665
- throw new Error('The \'importAttributes\' plugin has been removed in Babel 8. If you need to enable support for the deprecated `assert` syntax, you can enable the `deprecatedImportAssert` parser plugin.');
29666
- }
29585
+ if (pluginsMap.has('deprecatedImportAssert')) {
29586
+ console.warn('`deprecatedImportAssert` has been removed in Babel 8, please use import attributes instead.');
29587
+ } else if (pluginsMap.has('importAttributes') && pluginsMap.get('importAttributes').deprecatedAssertSyntax) {
29588
+ console.warn('The \'importAttributes\' plugin has been removed in Babel 8. Please migrate any usage of `assert`-style attributes to `with`.');
29667
29589
  }
29668
29590
 
29669
29591
  if (pluginsMap.has('recordAndTuple')) {
29670
- {
29671
- throw new Error('The \'recordAndTuple\' plugin has been removed in Babel 8. Please remove it from your configuration.');
29672
- }
29592
+ throw new Error('The \'recordAndTuple\' plugin has been removed in Babel 8. Please remove it from your configuration.');
29673
29593
  }
29674
29594
 
29675
29595
  if (pluginsMap.has('asyncDoExpressions') && !pluginsMap.has('doExpressions')) {
@@ -29687,14 +29607,12 @@ function validatePlugins(pluginsMap) {
29687
29607
  throw new Error('The \'discardBinding\' plugin requires a \'syntaxType\' option. Currently the only supported value is \'void\'.');
29688
29608
  }
29689
29609
 
29690
- {
29691
- if (pluginsMap.has('decimal')) {
29692
- throw new Error('The \'decimal\' plugin has been removed in Babel 8. Please remove it from your configuration.');
29693
- }
29694
-
29695
- if (pluginsMap.has('importReflection')) {
29696
- throw new Error('The \'importReflection\' plugin has been removed in Babel 8. Use \'sourcePhaseImports\' instead, and replace \'import module\' with \'import source\' in your code.');
29697
- }
29610
+ if (pluginsMap.has('decimal')) {
29611
+ throw new Error('The \'decimal\' plugin has been removed in Babel 8. Please remove it from your configuration.');
29612
+ }
29613
+
29614
+ if (pluginsMap.has('importReflection')) {
29615
+ throw new Error('The \'importReflection\' plugin has been removed in Babel 8. Use \'sourcePhaseImports\' instead, and replace \'import module\' with \'import source\' in your code.');
29698
29616
  }
29699
29617
  }
29700
29618
 
@@ -30615,14 +30533,12 @@ var ExpressionParser = class extends LValParser {
30615
30533
 
30616
30534
  finishTopicReference(node, startLoc, pipeProposal, tokenType) {
30617
30535
  if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
30618
- {
30619
- if (!this.topicReferenceIsAllowedInCurrentContext()) {
30620
- this.raise(Errors.PipeTopicUnbound, startLoc);
30621
- }
30622
-
30623
- this.registerTopicReference();
30624
- return this.finishNode(node, 'TopicReference');
30536
+ if (!this.topicReferenceIsAllowedInCurrentContext()) {
30537
+ this.raise(Errors.PipeTopicUnbound, startLoc);
30625
30538
  }
30539
+
30540
+ this.registerTopicReference();
30541
+ return this.finishNode(node, 'TopicReference');
30626
30542
  } else {
30627
30543
  throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, {
30628
30544
  token: tokenLabelName(tokenType),
@@ -30691,13 +30607,9 @@ var ExpressionParser = class extends LValParser {
30691
30607
  this.next();
30692
30608
 
30693
30609
  if (this.match(10) && !this.scope.allowDirectSuper) {
30694
- {
30695
- this.raise(Errors.SuperNotAllowed, node);
30696
- }
30610
+ this.raise(Errors.SuperNotAllowed, node);
30697
30611
  } else if (!this.scope.allowSuper) {
30698
- {
30699
- this.raise(Errors.UnexpectedSuper, node);
30700
- }
30612
+ this.raise(Errors.UnexpectedSuper, node);
30701
30613
  }
30702
30614
 
30703
30615
  if (!this.match(10) && !this.match(0) && !this.match(16)) {
@@ -30799,20 +30711,18 @@ var ExpressionParser = class extends LValParser {
30799
30711
  }
30800
30712
 
30801
30713
  parseBigIntLiteral(value) {
30802
- {
30803
- let bigInt;
30804
-
30805
- try {
30806
- bigInt = BigInt(value);
30807
- } catch {
30808
- bigInt = null;
30809
- }
30714
+ let bigInt;
30715
+
30716
+ try {
30717
+ bigInt = BigInt(value);
30718
+ } catch {
30719
+ bigInt = null;
30720
+ }
30810
30721
 
30811
30722
 
30812
- const node = this.parseLiteral(bigInt, 'BigIntLiteral');
30813
-
30814
- return node;
30815
- }
30723
+ const node = this.parseLiteral(bigInt, 'BigIntLiteral');
30724
+
30725
+ return node;
30816
30726
  }
30817
30727
 
30818
30728
  parseDecimalLiteral(value) {
@@ -31788,9 +31698,7 @@ var ExpressionParser = class extends LValParser {
31788
31698
  }
31789
31699
 
31790
31700
  withSmartMixTopicForbiddingContext(callback) {
31791
- {
31792
- return callback();
31793
- }
31701
+ return callback();
31794
31702
  }
31795
31703
 
31796
31704
  withSoloAwaitPermittingContext(callback) {
@@ -33557,9 +33465,7 @@ var StatementParser = class extends ExpressionParser {
33557
33465
  const isTypeExport = node2.exportKind === 'type';
33558
33466
  node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport));
33559
33467
  node2.source = null;
33560
- {
33561
- node2.attributes = [];
33562
- }
33468
+ node2.attributes = [];
33563
33469
  node2.declaration = null;
33564
33470
  return true;
33565
33471
  }
@@ -33571,9 +33477,7 @@ var StatementParser = class extends ExpressionParser {
33571
33477
  if (this.shouldParseExportDeclaration()) {
33572
33478
  node.specifiers = [];
33573
33479
  node.source = null;
33574
- {
33575
- node.attributes = [];
33576
- }
33480
+ node.attributes = [];
33577
33481
  node.declaration = this.parseExportDeclaration(node);
33578
33482
  return true;
33579
33483
  }
@@ -34115,27 +34019,13 @@ var StatementParser = class extends ExpressionParser {
34115
34019
  return;
34116
34020
  }
34117
34021
 
34118
- this.next();
34119
- {
34120
- attributes = this.parseImportAttributes();
34121
- }
34122
- } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
34123
- if (!this.hasPlugin('deprecatedImportAssert')) {
34124
- this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc);
34125
- }
34126
-
34127
- {
34128
- this.addExtra(node, 'deprecatedAssertSyntax', true);
34129
- }
34130
34022
  this.next();
34131
34023
  attributes = this.parseImportAttributes();
34132
34024
  } else {
34133
34025
  attributes = [];
34134
34026
  }
34135
34027
 
34136
- {
34137
- node.attributes = attributes;
34138
- }
34028
+ node.attributes = attributes;
34139
34029
  }
34140
34030
 
34141
34031
  maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) {
@@ -34465,119 +34355,117 @@ var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
34465
34355
  var BRACKET = /^[()[\]{}]$/;
34466
34356
  var tokenize;
34467
34357
 
34468
- {
34469
- const getTokenType = function(token) {
34470
- if (token.type === 'IdentifierName') {
34471
- const tokenValue = token.value;
34472
-
34473
- if (isKeyword(tokenValue) || isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {
34474
- return 'keyword';
34475
- }
34476
-
34477
- const firstChar = tokenValue.charCodeAt(0);
34478
-
34479
- if (firstChar < 128) {
34480
- if (firstChar >= 65 && firstChar <= 90) {
34481
- return 'capitalized';
34482
- }
34483
- } else {
34484
- const firstChar2 = String.fromCodePoint(tokenValue.codePointAt(0));
34485
-
34486
- if (firstChar2 !== firstChar2.toLowerCase()) {
34487
- return 'capitalized';
34488
- }
34489
- }
34490
- }
34358
+ var getTokenType = function(token) {
34359
+ if (token.type === 'IdentifierName') {
34360
+ const tokenValue = token.value;
34491
34361
 
34492
- if (token.type === 'Punctuator' && BRACKET.test(token.value)) {
34493
- return 'uncolored';
34362
+ if (isKeyword(tokenValue) || isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {
34363
+ return 'keyword';
34494
34364
  }
34495
34365
 
34496
- if (token.type === 'Invalid' && token.value === '@') {
34497
- return 'punctuator';
34498
- }
34366
+ const firstChar = tokenValue.charCodeAt(0);
34499
34367
 
34368
+ if (firstChar < 128) {
34369
+ if (firstChar >= 65 && firstChar <= 90) {
34370
+ return 'capitalized';
34371
+ }
34372
+ } else {
34373
+ const firstChar2 = String.fromCodePoint(tokenValue.codePointAt(0));
34374
+
34375
+ if (firstChar2 !== firstChar2.toLowerCase()) {
34376
+ return 'capitalized';
34377
+ }
34378
+ }
34379
+ }
34380
+
34381
+ if (token.type === 'Punctuator' && BRACKET.test(token.value)) {
34382
+ return 'uncolored';
34383
+ }
34384
+
34385
+ if (token.type === 'Invalid' && token.value === '@') {
34386
+ return 'punctuator';
34387
+ }
34388
+
34389
+ switch(token.type) {
34390
+ case 'NumericLiteral':
34391
+ return 'number';
34392
+
34393
+ case 'StringLiteral':
34394
+ case 'JSXString':
34395
+ case 'NoSubstitutionTemplate':
34396
+ return 'string';
34397
+
34398
+ case 'RegularExpressionLiteral':
34399
+ return 'regex';
34400
+
34401
+ case 'Punctuator':
34402
+ case 'JSXPunctuator':
34403
+ return 'punctuator';
34404
+
34405
+ case 'MultiLineComment':
34406
+ case 'SingleLineComment':
34407
+ return 'comment';
34408
+
34409
+ case 'Invalid':
34410
+ case 'JSXInvalid':
34411
+ return 'invalid';
34412
+
34413
+ case 'JSXIdentifier':
34414
+ return 'jsxIdentifier';
34415
+
34416
+ default:
34417
+ return 'uncolored';
34418
+ }
34419
+ };
34420
+
34421
+ tokenize = function*(text) {
34422
+ for (const token of (0, import_js_tokens.default)(text, {jsx: true})) {
34500
34423
  switch(token.type) {
34501
- case 'NumericLiteral':
34502
- return 'number';
34503
-
34504
- case 'StringLiteral':
34505
- case 'JSXString':
34506
- case 'NoSubstitutionTemplate':
34507
- return 'string';
34508
-
34509
- case 'RegularExpressionLiteral':
34510
- return 'regex';
34511
-
34512
- case 'Punctuator':
34513
- case 'JSXPunctuator':
34514
- return 'punctuator';
34515
-
34516
- case 'MultiLineComment':
34517
- case 'SingleLineComment':
34518
- return 'comment';
34424
+ case 'TemplateHead':
34425
+ yield {
34426
+ type: 'string',
34427
+ value: token.value.slice(0, -2),
34428
+ };
34429
+ yield {
34430
+ type: 'punctuator',
34431
+ value: '${',
34432
+ };
34433
+ break;
34519
34434
 
34520
- case 'Invalid':
34521
- case 'JSXInvalid':
34522
- return 'invalid';
34435
+ case 'TemplateMiddle':
34436
+ yield {
34437
+ type: 'punctuator',
34438
+ value: '}',
34439
+ };
34440
+ yield {
34441
+ type: 'string',
34442
+ value: token.value.slice(1, -2),
34443
+ };
34444
+ yield {
34445
+ type: 'punctuator',
34446
+ value: '${',
34447
+ };
34448
+ break;
34523
34449
 
34524
- case 'JSXIdentifier':
34525
- return 'jsxIdentifier';
34450
+ case 'TemplateTail':
34451
+ yield {
34452
+ type: 'punctuator',
34453
+ value: '}',
34454
+ };
34455
+ yield {
34456
+ type: 'string',
34457
+ value: token.value.slice(1),
34458
+ };
34459
+ break;
34526
34460
 
34527
34461
  default:
34528
- return 'uncolored';
34529
- }
34530
- };
34531
-
34532
- tokenize = function*(text) {
34533
- for (const token of (0, import_js_tokens.default)(text, {jsx: true})) {
34534
- switch(token.type) {
34535
- case 'TemplateHead':
34536
- yield {
34537
- type: 'string',
34538
- value: token.value.slice(0, -2),
34539
- };
34540
- yield {
34541
- type: 'punctuator',
34542
- value: '${',
34543
- };
34544
- break;
34545
-
34546
- case 'TemplateMiddle':
34547
- yield {
34548
- type: 'punctuator',
34549
- value: '}',
34550
- };
34551
- yield {
34552
- type: 'string',
34553
- value: token.value.slice(1, -2),
34554
- };
34555
- yield {
34556
- type: 'punctuator',
34557
- value: '${',
34558
- };
34559
- break;
34560
-
34561
- case 'TemplateTail':
34562
- yield {
34563
- type: 'punctuator',
34564
- value: '}',
34565
- };
34566
- yield {
34567
- type: 'string',
34568
- value: token.value.slice(1),
34569
- };
34570
- break;
34571
-
34572
- default:
34573
- yield {
34574
- type: getTokenType(token),
34575
- value: token.value,
34576
- };
34577
- }
34462
+ yield {
34463
+ type: getTokenType(token),
34464
+ value: token.value,
34465
+ };
34578
34466
  }
34579
- };
34580
- }
34467
+ }
34468
+ };
34581
34469
  function highlight(text) {
34582
34470
  if (text === '')
34583
34471
  return '';
@@ -37916,9 +37804,7 @@ function* childrenIterator(node) {
37916
37804
 
37917
37805
  function TaggedTemplateExpression2(node) {
37918
37806
  this.print(node.tag);
37919
- {
37920
- this.print(node.typeArguments);
37921
- }
37807
+ this.print(node.typeArguments);
37922
37808
  this.print(node.quasi);
37923
37809
  }
37924
37810
 
@@ -39091,18 +38977,14 @@ function ExportNamespaceSpecifier2(node) {
39091
38977
  }
39092
38978
 
39093
38979
  function _printAttributes(node, hasPreviousBrace) {
39094
- const {importAttributesKeyword} = this.format;
39095
-
39096
- const {attributes, assertions} = node;
39097
-
39098
- const useAssertKeyword = importAttributesKeyword === 'assert' || !importAttributesKeyword && assertions;
38980
+ const {attributes} = node;
39099
38981
 
39100
- this.word(useAssertKeyword ? 'assert' : 'with');
38982
+ this.word('with');
39101
38983
  this.space();
39102
38984
  const occurrenceCount = hasPreviousBrace ? 1 : 0;
39103
38985
  this.token('{', void 0, occurrenceCount);
39104
38986
  this.space();
39105
- this.printList(attributes || assertions, this.shouldPrintTrailingComma('}'));
38987
+ this.printList(attributes, this.shouldPrintTrailingComma('}'));
39106
38988
  this.space();
39107
38989
  this.token('}', void 0, occurrenceCount);
39108
38990
  }
@@ -39121,7 +39003,7 @@ function ExportAllDeclaration2(node) {
39121
39003
  this.word('from');
39122
39004
  this.space();
39123
39005
 
39124
- if (node.attributes?.length || node.assertions?.length) {
39006
+ if (node.attributes?.length) {
39125
39007
  this.print(node.source, true);
39126
39008
  this.space();
39127
39009
  this._printAttributes(node, false);
@@ -39194,7 +39076,7 @@ function ExportNamedDeclaration2(node) {
39194
39076
  this.word('from');
39195
39077
  this.space();
39196
39078
 
39197
- if (node.attributes?.length || node.assertions?.length) {
39079
+ if (node.attributes?.length) {
39198
39080
  this.print(node.source, true);
39199
39081
  this.space();
39200
39082
  this._printAttributes(node, hasBrace);
@@ -39280,7 +39162,7 @@ function ImportDeclaration2(node) {
39280
39162
  this.space();
39281
39163
  }
39282
39164
 
39283
- if (node.attributes?.length || node.assertions?.length) {
39165
+ if (node.attributes?.length) {
39284
39166
  this.print(node.source, true);
39285
39167
  this.space();
39286
39168
  this._printAttributes(node, hasBrace);
@@ -39445,9 +39327,6 @@ function ArrayExpression2(node) {
39445
39327
  this.tokenChar(93);
39446
39328
  }
39447
39329
 
39448
- var RecordExpression;
39449
- var TupleExpression;
39450
-
39451
39330
  function RegExpLiteral2(node) {
39452
39331
  this.word(`/${node.pattern}/${node.flags}`);
39453
39332
  }
@@ -40370,9 +40249,8 @@ function spaceSeparator() {
40370
40249
  function JSXOpeningElement2(node) {
40371
40250
  this.tokenChar(60);
40372
40251
  this.print(node.name);
40373
- {
40374
- this.print(node.typeArguments);
40375
- }
40252
+ this.print(node.typeArguments);
40253
+
40376
40254
  if (node.attributes.length > 0) {
40377
40255
  this.space();
40378
40256
  this.printJoin(node.attributes, void 0, void 0, spaceSeparator);
@@ -40400,7 +40278,6 @@ function JSXEmptyExpression2() {
40400
40278
  function JSXFragment2(node) {
40401
40279
  this.print(node.openingFragment);
40402
40280
  this.indent();
40403
-
40404
40281
  for (const child of node.children) {
40405
40282
  this.print(child);
40406
40283
  }
@@ -40831,15 +40708,12 @@ function TSMappedType2(node) {
40831
40708
  }
40832
40709
 
40833
40710
  this.tokenChar(91);
40834
- {
40835
- this.word(node.key.name);
40836
- }
40711
+ this.word(node.key.name);
40837
40712
  this.space();
40838
40713
  this.word('in');
40839
40714
  this.space();
40840
- {
40841
- this.print(node.constraint);
40842
- }
40715
+ this.print(node.constraint);
40716
+
40843
40717
  if (nameType) {
40844
40718
  this.space();
40845
40719
  this.word('as');
@@ -40968,9 +40842,7 @@ function TSTypeAssertion2(node) {
40968
40842
 
40969
40843
  function TSInstantiationExpression2(node) {
40970
40844
  this.print(node.expression);
40971
- {
40972
- this.print(node.typeArguments);
40973
- }
40845
+ this.print(node.typeArguments);
40974
40846
  }
40975
40847
 
40976
40848
  function TSEnumDeclaration2(node) {
@@ -40994,9 +40866,7 @@ function TSEnumDeclaration2(node) {
40994
40866
  this.space();
40995
40867
  this.print(id);
40996
40868
  this.space();
40997
- {
40998
- this.print(node.body);
40999
- }
40869
+ this.print(node.body);
41000
40870
  }
41001
40871
 
41002
40872
  function TSEnumBody2(node) {
@@ -41024,22 +40894,20 @@ function TSModuleDeclaration2(node) {
41024
40894
  this.space();
41025
40895
  }
41026
40896
 
41027
- {
41028
- if (kind !== 'global') {
41029
- this.word(kind);
41030
- this.space();
41031
- }
41032
-
41033
- this.print(node.id);
41034
-
41035
- if (!node.body) {
41036
- this.semicolon();
41037
- return;
41038
- }
41039
-
40897
+ if (kind !== 'global') {
40898
+ this.word(kind);
41040
40899
  this.space();
41041
- this.print(node.body);
41042
40900
  }
40901
+
40902
+ this.print(node.id);
40903
+
40904
+ if (!node.body) {
40905
+ this.semicolon();
40906
+ return;
40907
+ }
40908
+
40909
+ this.space();
40910
+ this.print(node.body);
41043
40911
  }
41044
40912
 
41045
40913
  function TSModuleBlock2(node) {
@@ -41047,15 +40915,11 @@ function TSModuleBlock2(node) {
41047
40915
  }
41048
40916
 
41049
40917
  function TSImportType2(node) {
41050
- const {
41051
- argument,
41052
- qualifier,
41053
- options,
41054
- } = node;
40918
+ const {qualifier, options} = node;
41055
40919
 
41056
40920
  this.word('import');
41057
40921
  this.tokenChar(40);
41058
- this.print(argument);
40922
+ this.print(node.source);
41059
40923
 
41060
40924
  if (options) {
41061
40925
  this.tokenChar(44);
@@ -41324,7 +41188,6 @@ var generatorFunctions = /* @__PURE__ */Object.freeze({
41324
41188
  PrivateName: PrivateName2,
41325
41189
  Program: Program2,
41326
41190
  QualifiedTypeIdentifier: QualifiedTypeIdentifier2,
41327
- RecordExpression,
41328
41191
  RegExpLiteral: RegExpLiteral2,
41329
41192
  RestElement: RestElement2,
41330
41193
  ReturnStatement: ReturnStatement2,
@@ -41414,7 +41277,6 @@ var generatorFunctions = /* @__PURE__ */Object.freeze({
41414
41277
  ThrowStatement: ThrowStatement2,
41415
41278
  TopicReference: TopicReference2,
41416
41279
  TryStatement: TryStatement2,
41417
- TupleExpression,
41418
41280
  TupleTypeAnnotation: TupleTypeAnnotation2,
41419
41281
  TypeAlias: TypeAlias2,
41420
41282
  TypeAnnotation: TypeAnnotation2,
@@ -42537,7 +42399,6 @@ function normalizeOptions(code2, opts, ast) {
42537
42399
  minimal: true,
42538
42400
  }, opts.jsescOption),
42539
42401
  topicToken: opts.topicToken,
42540
- importAttributesKeyword: opts.importAttributesKeyword,
42541
42402
  };
42542
42403
 
42543
42404
  if (format.minified) {
@@ -43180,9 +43041,7 @@ var _environmentVisitor = {
43180
43041
  path.skip();
43181
43042
 
43182
43043
  if (path.isMethod()) {
43183
- {
43184
- path.requeueComputedKeyAndDecorators();
43185
- }
43044
+ path.requeueComputedKeyAndDecorators();
43186
43045
  }
43187
43046
  },
43188
43047
  Property(path) {
@@ -43190,9 +43049,7 @@ var _environmentVisitor = {
43190
43049
  return;
43191
43050
 
43192
43051
  path.skip();
43193
- {
43194
- path.requeueComputedKeyAndDecorators();
43195
- }
43052
+ path.requeueComputedKeyAndDecorators();
43196
43053
  },
43197
43054
  };
43198
43055
 
@@ -43222,9 +43079,7 @@ var renameVisitor = {
43222
43079
  path.skip();
43223
43080
 
43224
43081
  if (path.isMethod()) {
43225
- {
43226
- path.requeueComputedKeyAndDecorators();
43227
- }
43082
+ path.requeueComputedKeyAndDecorators();
43228
43083
  }
43229
43084
  }
43230
43085
  },
@@ -43321,11 +43176,10 @@ var Renamer = class {
43321
43176
  }
43322
43177
 
43323
43178
  traverseNode(blockToTraverse, explode$1(renameVisitor), scope2, this, scope2.path, skipKeys);
43324
- {
43325
- scope2.removeOwnBinding(oldName);
43326
- scope2.bindings[newName] = binding;
43327
- this.binding.identifier.name = newName;
43328
- }
43179
+ scope2.removeOwnBinding(oldName);
43180
+ scope2.bindings[newName] = binding;
43181
+ this.binding.identifier.name = newName;
43182
+
43329
43183
  if (parentDeclar) {
43330
43184
  this.maybeConvertFromClassFunctionDeclaration(path);
43331
43185
  this.maybeConvertFromClassFunctionExpression(path);
@@ -43969,12 +43823,8 @@ var _Scope = class _Scope {
43969
43823
  i++;
43970
43824
  } while (this.hasLabel(uid2) || this.hasBinding(uid2) || this.hasGlobal(uid2) || this.hasReference(uid2))
43971
43825
  const program3 = this.getProgramParent();
43972
-
43973
- {
43974
- program3.referencesSet.add(uid2);
43975
- program3.uidsSet.add(uid2);
43976
- }
43977
-
43826
+ program3.referencesSet.add(uid2);
43827
+ program3.uidsSet.add(uid2);
43978
43828
  return uid2;
43979
43829
  }
43980
43830
 
@@ -44053,10 +43903,7 @@ var _Scope = class _Scope {
44053
43903
  if (binding) {
44054
43904
  newName || (newName = this.generateUidIdentifier(oldName).name);
44055
43905
  const renamer = new Renamer(binding, oldName, newName);
44056
-
44057
- {
44058
- renamer.rename();
44059
- }
43906
+ renamer.rename();
44060
43907
  }
44061
43908
  }
44062
43909
 
@@ -44166,9 +44013,7 @@ var _Scope = class _Scope {
44166
44013
  const ids = path.getOuterBindingIdentifiers(true);
44167
44014
 
44168
44015
  for (const name of Object.keys(ids)) {
44169
- {
44170
- parent.referencesSet.add(name);
44171
- }
44016
+ parent.referencesSet.add(name);
44172
44017
 
44173
44018
  for (const id of ids[name]) {
44174
44019
  const local = this.getOwnBinding(name);
@@ -44199,12 +44044,10 @@ var _Scope = class _Scope {
44199
44044
  }
44200
44045
 
44201
44046
  hasUid(name) {
44202
- {
44203
- return this
44204
- .getProgramParent()
44205
- .uidsSet
44206
- .has(name);
44207
- }
44047
+ return this
44048
+ .getProgramParent()
44049
+ .uidsSet
44050
+ .has(name);
44208
44051
  }
44209
44052
 
44210
44053
  hasGlobal(name) {
@@ -44219,12 +44062,10 @@ var _Scope = class _Scope {
44219
44062
  }
44220
44063
 
44221
44064
  hasReference(name) {
44222
- {
44223
- return this
44224
- .getProgramParent()
44225
- .referencesSet
44226
- .has(name);
44227
- }
44065
+ return this
44066
+ .getProgramParent()
44067
+ .referencesSet
44068
+ .has(name);
44228
44069
  }
44229
44070
 
44230
44071
  isPure(node, constantsOnly) {
@@ -44416,9 +44257,7 @@ collectorVisitor]));
44416
44257
  }
44417
44258
  }
44418
44259
 
44419
- {
44420
- traverseForScope(path, scopeVisitor, state);
44421
- }
44260
+ traverseForScope(path, scopeVisitor, state);
44422
44261
  this.crawling = false;
44423
44262
 
44424
44263
  for (const path2 of state.assignments) {
@@ -44662,12 +44501,10 @@ collectorVisitor]));
44662
44501
 
44663
44502
  removeBinding(name) {
44664
44503
  this.getBinding(name)?.scope.removeOwnBinding(name);
44665
- {
44666
- this
44667
- .getProgramParent()
44668
- .uidsSet
44669
- .delete(name);
44670
- }
44504
+ this
44505
+ .getProgramParent()
44506
+ .uidsSet
44507
+ .delete(name);
44671
44508
  }
44672
44509
 
44673
44510
  hoistVariables(emit = (id) => this.push({
@@ -44903,14 +44740,12 @@ var {
44903
44740
  } = lib_exports;
44904
44741
 
44905
44742
  function createUnionType(types2) {
44906
- {
44907
- if (types2.every((v) => isFlowType2(v))) {
44908
- return createFlowUnionType2(types2);
44909
- }
44910
-
44911
- if (types2.every((v) => isTSType2(v))) {
44912
- return createTSUnionType2(types2);
44913
- }
44743
+ if (types2.every((v) => isFlowType2(v))) {
44744
+ return createFlowUnionType2(types2);
44745
+ }
44746
+
44747
+ if (types2.every((v) => isTSType2(v))) {
44748
+ return createTSUnionType2(types2);
44914
44749
  }
44915
44750
  }
44916
44751
 
@@ -46096,10 +45931,8 @@ function replaceExpressionWithStatements(nodes2) {
46096
45931
 
46097
45932
  callee.arrowFunctionToExpression();
46098
45933
  const newCallee = callee;
46099
- const needToAwaitFunction = isParentAsync && traverse3.hasType(this
46100
- .get('callee.body').node, 'AwaitExpression', FUNCTION_TYPES2);
46101
- const needToYieldFunction = isParentGenerator && traverse3.hasType(this
46102
- .get('callee.body').node, 'YieldExpression', FUNCTION_TYPES2);
45934
+ const needToAwaitFunction = isParentAsync && traverse3.hasType(newCallee.node.body, 'AwaitExpression', FUNCTION_TYPES2);
45935
+ const needToYieldFunction = isParentGenerator && traverse3.hasType(newCallee.node.body, 'YieldExpression', FUNCTION_TYPES2);
46103
45936
 
46104
45937
  if (needToAwaitFunction) {
46105
45938
  newCallee.set('async', true);
@@ -46408,17 +46241,23 @@ function _evaluate(path, state) {
46408
46241
  return;
46409
46242
  }
46410
46243
 
46411
- const resolved = path.resolve();
46412
-
46413
- if (resolved === path) {
46244
+ if (!binding) {
46414
46245
  deopt(path, state);
46415
46246
  return;
46416
46247
  }
46417
46248
 
46418
- const value = evaluateCached(resolved, state);
46249
+ const bindingPath = binding.path;
46250
+
46251
+ if (!bindingPath.isVariableDeclarator()) {
46252
+ deopt(bindingPath, state);
46253
+ return;
46254
+ }
46255
+
46256
+ const initPath = bindingPath.get('init');
46257
+ const value = evaluateCached(initPath, state);
46419
46258
 
46420
46259
  if (typeof value === 'object' && value !== null && binding.references > 1) {
46421
- deopt(resolved, state);
46260
+ deopt(initPath, state);
46422
46261
  return;
46423
46262
  }
46424
46263
 
@@ -47377,26 +47216,20 @@ function ensureFunctionName(supportUnicodeId) {
47377
47216
 
47378
47217
  if (!state.needsRename) {
47379
47218
  this.node.id = id;
47380
- {
47381
- scope2
47382
- .getProgramParent()
47383
- .referencesSet
47384
- .add(id.name);
47385
- }
47386
-
47219
+ scope2
47220
+ .getProgramParent()
47221
+ .referencesSet
47222
+ .add(id.name);
47387
47223
  return this;
47388
47224
  }
47389
47225
 
47390
47226
  if (scope2.hasBinding(id.name) && !scope2.hasGlobal(id.name)) {
47391
47227
  scope2.rename(id.name);
47392
47228
  this.node.id = id;
47393
- {
47394
- scope2
47395
- .getProgramParent()
47396
- .referencesSet
47397
- .add(id.name);
47398
- }
47399
-
47229
+ scope2
47230
+ .getProgramParent()
47231
+ .referencesSet
47232
+ .add(id.name);
47400
47233
  return this;
47401
47234
  }
47402
47235
 
@@ -48974,9 +48807,7 @@ function _traverse(node, opts, scope2, state, path, skipKeys, visitSelf) {
48974
48807
  }
48975
48808
 
48976
48809
  function traverseNode(node, opts, scope2, state, path, skipKeys, visitSelf) {
48977
- {
48978
- return _traverse(node, opts, scope2, state, path, skipKeys, visitSelf);
48979
- }
48810
+ return _traverse(node, opts, scope2, state, path, skipKeys, visitSelf);
48980
48811
  }
48981
48812
 
48982
48813
  function call(key) {
@@ -49230,9 +49061,7 @@ function requeue(pathToQueue = this) {
49230
49061
  if (pathToQueue.removed)
49231
49062
  return;
49232
49063
 
49233
- {
49234
- pathToQueue.shouldSkip = false;
49235
- }
49064
+ pathToQueue.shouldSkip = false;
49236
49065
  const contexts = this.contexts;
49237
49066
 
49238
49067
  for (const context of contexts) {