@putout/babel 5.0.7 → 5.1.1

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
@@ -4,12 +4,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
8
- enumerable: true,
9
- configurable: true,
10
- writable: true,
11
- value,
12
- }) : obj[key] = value;
13
7
 
14
8
  var __commonJS = (cb, mod) => function __require() {
15
9
  return (mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = {
@@ -46,14 +40,9 @@ isNodeMode || !mod || !mod.__esModule ? __defProp(target, 'default', {
46
40
  enumerable: true,
47
41
  }) : target, mod));
48
42
 
49
- var __toCommonJS = (mod) => __copyProps(__defProp({}, '__esModule', {
50
- value: true,
51
- }), mod);
52
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== 'symbol' ? key + '' : key, value);
53
-
54
43
  // ../babel-babel/node_modules/picocolors/picocolors.js
55
44
  var require_picocolors = __commonJS({
56
- '../babel-babel/node_modules/picocolors/picocolors.js'(exports2, module2) {
45
+ '../babel-babel/node_modules/picocolors/picocolors.js'(exports, module) {
57
46
  var p = process || {};
58
47
  var argv = p.argv || [];
59
48
  var env = p.env || {};
@@ -131,14 +120,14 @@ var require_picocolors = __commonJS({
131
120
  };
132
121
  };
133
122
 
134
- module2.exports = createColors2();
135
- module2.exports.createColors = createColors2;
123
+ module.exports = createColors2();
124
+ module.exports.createColors = createColors2;
136
125
  },
137
126
  });
138
127
 
139
128
  // ../babel-babel/node_modules/jsesc/jsesc.js
140
129
  var require_jsesc = __commonJS({
141
- '../babel-babel/node_modules/jsesc/jsesc.js'(exports2, module2) {
130
+ '../babel-babel/node_modules/jsesc/jsesc.js'(exports, module) {
142
131
  "use strict";
143
132
 
144
133
  var object = {};
@@ -481,24 +470,10 @@ var require_jsesc = __commonJS({
481
470
  };
482
471
 
483
472
  jsesc2.version = '3.0.2';
484
- module2.exports = jsesc2;
473
+ module.exports = jsesc2;
485
474
  },
486
475
  });
487
476
 
488
- // lib/index.mjs
489
- var index_exports = {};
490
-
491
- __export(index_exports, {
492
- codeFrameColumns: () => codeFrameColumns,
493
- generate: () => generate,
494
- parse: () => parse,
495
- parseExpression: () => parseExpression,
496
- template: () => index,
497
- tokTypes: () => tokTypes,
498
- traverse: () => traverse3,
499
- types: () => lib_exports,
500
- });
501
- module.exports = __toCommonJS(index_exports);
502
477
  // ../babel-babel/packages/babel-types/lib/index.js
503
478
  var lib_exports = {};
504
479
 
@@ -7640,7 +7615,7 @@ function defineAliasedType(...aliases) {
7640
7615
  if (opts.inherits)
7641
7616
  defined = store[opts.inherits].aliases?.slice();
7642
7617
 
7643
- defined ?? (defined = []);
7618
+ defined ??= [];
7644
7619
  opts.aliases = defined;
7645
7620
  }
7646
7621
 
@@ -17960,10 +17935,10 @@ var react = {
17960
17935
 
17961
17936
  // ../babel-babel/packages/babel-parser/lib/index.js
17962
17937
  var Position = class {
17938
+ line;
17939
+ column;
17940
+ index;
17963
17941
  constructor(line, col, index2) {
17964
- __publicField(this, 'line');
17965
- __publicField(this, 'column');
17966
- __publicField(this, 'index');
17967
17942
  this.line = line;
17968
17943
  this.column = col;
17969
17944
  this.index = index2;
@@ -17971,11 +17946,11 @@ var Position = class {
17971
17946
  };
17972
17947
 
17973
17948
  var SourceLocation = class {
17949
+ start;
17950
+ end;
17951
+ filename;
17952
+ identifierName;
17974
17953
  constructor(start, end) {
17975
- __publicField(this, 'start');
17976
- __publicField(this, 'end');
17977
- __publicField(this, 'filename');
17978
- __publicField(this, 'identifierName');
17979
17954
  this.start = start;
17980
17955
  this.end = end;
17981
17956
  }
@@ -18861,17 +18836,17 @@ var prefix = true;
18861
18836
  var postfix = true;
18862
18837
 
18863
18838
  var ExportedTokenType = class {
18839
+ label;
18840
+ keyword;
18841
+ beforeExpr;
18842
+ startsExpr;
18843
+ rightAssociative;
18844
+ isLoop;
18845
+ isAssign;
18846
+ prefix;
18847
+ postfix;
18848
+ binop;
18864
18849
  constructor(label, conf = {}) {
18865
- __publicField(this, 'label');
18866
- __publicField(this, 'keyword');
18867
- __publicField(this, 'beforeExpr');
18868
- __publicField(this, 'startsExpr');
18869
- __publicField(this, 'rightAssociative');
18870
- __publicField(this, 'isLoop');
18871
- __publicField(this, 'isAssign');
18872
- __publicField(this, 'prefix');
18873
- __publicField(this, 'postfix');
18874
- __publicField(this, 'binop');
18875
18850
  this.label = label;
18876
18851
  this.keyword = conf.keyword;
18877
18852
  this.beforeExpr = !!conf.beforeExpr;
@@ -19390,11 +19365,12 @@ function getExportedToken(token) {
19390
19365
 
19391
19366
  var TokContext = class {
19392
19367
  constructor(token, preserveSpace) {
19393
- __publicField(this, 'token');
19394
- __publicField(this, 'preserveSpace');
19395
19368
  this.token = token;
19396
19369
  this.preserveSpace = !!preserveSpace;
19397
19370
  }
19371
+
19372
+ token;
19373
+ preserveSpace;
19398
19374
  };
19399
19375
 
19400
19376
  var types = {
@@ -20560,20 +20536,20 @@ function canBeReservedWord(word) {
20560
20536
  }
20561
20537
 
20562
20538
  var Scope = class {
20539
+ flags = 0;
20540
+ names = /* @__PURE__ */new Map();
20541
+ firstLexicalName = '';
20563
20542
  constructor(flags) {
20564
- __publicField(this, 'flags', 0);
20565
- __publicField(this, 'names', /* @__PURE__ */new Map());
20566
- __publicField(this, 'firstLexicalName', '');
20567
20543
  this.flags = flags;
20568
20544
  }
20569
20545
  };
20570
20546
 
20571
20547
  var ScopeHandler = class {
20548
+ parser;
20549
+ scopeStack = [];
20550
+ inModule;
20551
+ undefinedExports = /* @__PURE__ */new Map();
20572
20552
  constructor(parser, inModule) {
20573
- __publicField(this, 'parser');
20574
- __publicField(this, 'scopeStack', []);
20575
- __publicField(this, 'inModule');
20576
- __publicField(this, 'undefinedExports', /* @__PURE__ */new Map());
20577
20553
  this.parser = parser;
20578
20554
  this.inModule = inModule;
20579
20555
  }
@@ -21585,18 +21561,11 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
21585
21561
  };
21586
21562
 
21587
21563
  var TypeScriptScope = class extends Scope {
21588
- constructor() {
21589
- super(...arguments);
21590
- __publicField(this, 'tsNames', /* @__PURE__ */new Map());
21591
- }
21564
+ tsNames = /* @__PURE__ */new Map();
21592
21565
  };
21593
21566
 
21594
21567
  var TypeScriptScopeHandler = class extends ScopeHandler {
21595
- constructor() {
21596
- super(...arguments);
21597
- __publicField(this, 'importsStack', []);
21598
- }
21599
-
21568
+ importsStack = [];
21600
21569
  createScope(flags) {
21601
21570
  this.importsStack.push( /* @__PURE__ */new Set());
21602
21571
  return new TypeScriptScope(flags);
@@ -21737,10 +21706,7 @@ var TypeScriptScopeHandler = class extends ScopeHandler {
21737
21706
  };
21738
21707
 
21739
21708
  var ProductionParameterHandler = class {
21740
- constructor() {
21741
- __publicField(this, 'stacks', []);
21742
- }
21743
-
21709
+ stacks = [];
21744
21710
  enter(flags) {
21745
21711
  this.stacks.push(flags);
21746
21712
  }
@@ -21775,11 +21741,8 @@ function functionFlags(isAsync, isGenerator) {
21775
21741
  }
21776
21742
 
21777
21743
  var BaseParser = class {
21778
- constructor() {
21779
- __publicField(this, 'sawUnambiguousESM', false);
21780
- __publicField(this, 'ambiguousScriptDifferentAst', false);
21781
- }
21782
-
21744
+ sawUnambiguousESM = false;
21745
+ ambiguousScriptDifferentAst = false;
21783
21746
  sourceToOffsetPos(sourcePos) {
21784
21747
  return sourcePos + this.startIndex;
21785
21748
  }
@@ -22026,37 +21989,7 @@ var CommentsParser = class extends BaseParser {
22026
21989
  };
22027
21990
 
22028
21991
  var State = class _State {
22029
- constructor() {
22030
- __publicField(this, 'flags', 1024);
22031
- __publicField(this, 'startIndex');
22032
- __publicField(this, 'curLine');
22033
- __publicField(this, 'lineStart');
22034
- __publicField(this, 'startLoc');
22035
- __publicField(this, 'endLoc');
22036
- __publicField(this, 'errors', []);
22037
- __publicField(this, 'potentialArrowAt', -1);
22038
- __publicField(this, 'noArrowAt', []);
22039
- __publicField(this, 'noArrowParamsConversionAt', []);
22040
- __publicField(this, 'topicContext', {
22041
- maxNumOfResolvableTopics: 0,
22042
- maxTopicIndex: null,
22043
- });
22044
- __publicField(this, 'labels', []);
22045
- __publicField(this, 'commentsLen', 0);
22046
- __publicField(this, 'commentStack', []);
22047
- __publicField(this, 'pos', 0);
22048
- __publicField(this, 'type', 135);
22049
- __publicField(this, 'value', null);
22050
- __publicField(this, 'start', 0);
22051
- __publicField(this, 'end', 0);
22052
- __publicField(this, 'lastTokEndLoc', null);
22053
- __publicField(this, 'lastTokStartLoc', null);
22054
- __publicField(this, 'context', [types.brace]);
22055
- __publicField(this, 'firstInvalidTemplateEscapePos', null);
22056
- __publicField(this, 'strictErrors', /* @__PURE__ */new Map());
22057
- __publicField(this, 'tokensLength', 0);
22058
- }
22059
-
21992
+ flags = 1024;
22060
21993
  get strict() {
22061
21994
  return (this.flags & 1) > 0;
22062
21995
  }
@@ -22068,6 +22001,11 @@ var State = class _State {
22068
22001
  this.flags &= -2;
22069
22002
  }
22070
22003
 
22004
+ startIndex;
22005
+ curLine;
22006
+ lineStart;
22007
+ startLoc;
22008
+ endLoc;
22071
22009
  init({strictMode, sourceType, startIndex, startLine, startColumn}) {
22072
22010
  this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === 'module';
22073
22011
  this.startIndex = startIndex;
@@ -22077,6 +22015,10 @@ var State = class _State {
22077
22015
  this.endLoc = new Position(startLine, startColumn, startIndex);
22078
22016
  }
22079
22017
 
22018
+ errors = [];
22019
+ potentialArrowAt = -1;
22020
+ noArrowAt = [];
22021
+ noArrowParamsConversionAt = [];
22080
22022
  get maybeInArrowParameters() {
22081
22023
  return (this.flags & 2) > 0;
22082
22024
  }
@@ -22154,6 +22096,10 @@ var State = class _State {
22154
22096
  this.flags &= -129;
22155
22097
  }
22156
22098
 
22099
+ topicContext = {
22100
+ maxNumOfResolvableTopics: 0,
22101
+ maxTopicIndex: null,
22102
+ };
22157
22103
  get soloAwait() {
22158
22104
  return (this.flags & 256) > 0;
22159
22105
  }
@@ -22176,6 +22122,17 @@ var State = class _State {
22176
22122
  this.flags &= -513;
22177
22123
  }
22178
22124
 
22125
+ labels = [];
22126
+ commentsLen = 0;
22127
+ commentStack = [];
22128
+ pos = 0;
22129
+ type = 135;
22130
+ value = null;
22131
+ start = 0;
22132
+ end = 0;
22133
+ lastTokEndLoc = null;
22134
+ lastTokStartLoc = null;
22135
+ context = [types.brace];
22179
22136
  get canStartJSXElement() {
22180
22137
  return (this.flags & 1024) > 0;
22181
22138
  }
@@ -22198,6 +22155,7 @@ var State = class _State {
22198
22155
  this.flags &= -2049;
22199
22156
  }
22200
22157
 
22158
+ firstInvalidTemplateEscapePos = null;
22201
22159
  get hasTopLevelAwait() {
22202
22160
  return (this.flags & 4096) > 0;
22203
22161
  }
@@ -22209,6 +22167,8 @@ var State = class _State {
22209
22167
  this.flags &= -4097;
22210
22168
  }
22211
22169
 
22170
+ strictErrors = /* @__PURE__ */new Map();
22171
+ tokensLength = 0;
22212
22172
  curPosition() {
22213
22173
  return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex);
22214
22174
  }
@@ -22627,44 +22587,10 @@ var Token = class {
22627
22587
  };
22628
22588
 
22629
22589
  var Tokenizer = class extends CommentsParser {
22590
+ isLookahead;
22591
+ tokens = [];
22630
22592
  constructor(options, input) {
22631
22593
  super();
22632
- __publicField(this, 'isLookahead');
22633
- __publicField(this, 'tokens', []);
22634
- __publicField(this, 'errorHandlers_readInt', {
22635
- invalidDigit: (pos, lineStart, curLine, radix) => {
22636
- if (!(this.optionFlags & 2048))
22637
- return false;
22638
-
22639
- this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
22640
- radix,
22641
- });
22642
- return true;
22643
- },
22644
- numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
22645
- unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator),
22646
- });
22647
- __publicField(this, 'errorHandlers_readCodePoint', {
22648
- ...this.errorHandlers_readInt,
22649
- invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),
22650
- invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint),
22651
- });
22652
- __publicField(this, 'errorHandlers_readStringContents_string', {
22653
- ...this.errorHandlers_readCodePoint,
22654
- strictNumericEscape: (pos, lineStart, curLine) => {
22655
- this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine));
22656
- },
22657
- unterminated: (pos, lineStart, curLine) => {
22658
- throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine));
22659
- },
22660
- });
22661
- __publicField(this, 'errorHandlers_readStringContents_template', {
22662
- ...this.errorHandlers_readCodePoint,
22663
- strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),
22664
- unterminated: (pos, lineStart, curLine) => {
22665
- throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine));
22666
- },
22667
- });
22668
22594
  this.state = new State();
22669
22595
  this.state.init(options);
22670
22596
  this.input = input;
@@ -23818,21 +23744,54 @@ var Tokenizer = class extends CommentsParser {
23818
23744
  this.raise(error, buildPosition(pos, lineStart, curLine));
23819
23745
  };
23820
23746
  }
23747
+
23748
+ errorHandlers_readInt = {
23749
+ invalidDigit: (pos, lineStart, curLine, radix) => {
23750
+ if (!(this.optionFlags & 2048))
23751
+ return false;
23752
+
23753
+ this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
23754
+ radix,
23755
+ });
23756
+ return true;
23757
+ },
23758
+ numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
23759
+ unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator),
23760
+ };
23761
+ errorHandlers_readCodePoint = {
23762
+ ...this.errorHandlers_readInt,
23763
+ invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),
23764
+ invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint),
23765
+ };
23766
+ errorHandlers_readStringContents_string = {
23767
+ ...this.errorHandlers_readCodePoint,
23768
+ strictNumericEscape: (pos, lineStart, curLine) => {
23769
+ this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine));
23770
+ },
23771
+ unterminated: (pos, lineStart, curLine) => {
23772
+ throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine));
23773
+ },
23774
+ };
23775
+ errorHandlers_readStringContents_template = {
23776
+ ...this.errorHandlers_readCodePoint,
23777
+ strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),
23778
+ unterminated: (pos, lineStart, curLine) => {
23779
+ throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine));
23780
+ },
23781
+ };
23821
23782
  };
23822
23783
 
23823
23784
  var ClassScope = class {
23824
- constructor() {
23825
- __publicField(this, 'privateNames', /* @__PURE__ */new Set());
23826
- __publicField(this, 'loneAccessors', /* @__PURE__ */new Map());
23827
- __publicField(this, 'undefinedPrivateNames', /* @__PURE__ */new Map());
23828
- }
23785
+ privateNames = /* @__PURE__ */new Set();
23786
+ loneAccessors = /* @__PURE__ */new Map();
23787
+ undefinedPrivateNames = /* @__PURE__ */new Map();
23829
23788
  };
23830
23789
 
23831
23790
  var ClassScopeHandler = class {
23791
+ parser;
23792
+ stack = [];
23793
+ undefinedPrivateNames = /* @__PURE__ */new Map();
23832
23794
  constructor(parser) {
23833
- __publicField(this, 'parser');
23834
- __publicField(this, 'stack', []);
23835
- __publicField(this, 'undefinedPrivateNames', /* @__PURE__ */new Map());
23836
23795
  this.parser = parser;
23837
23796
  }
23838
23797
 
@@ -23931,9 +23890,9 @@ var ExpressionScope = class {
23931
23890
  };
23932
23891
 
23933
23892
  var ArrowHeadParsingScope = class extends ExpressionScope {
23893
+ declarationErrors = /* @__PURE__ */new Map();
23934
23894
  constructor(type) {
23935
23895
  super(type);
23936
- __publicField(this, 'declarationErrors', /* @__PURE__ */new Map());
23937
23896
  }
23938
23897
 
23939
23898
  recordDeclarationError(ParsingErrorClass, at) {
@@ -23951,9 +23910,11 @@ var ArrowHeadParsingScope = class extends ExpressionScope {
23951
23910
  };
23952
23911
 
23953
23912
  var ExpressionScopeHandler = class {
23913
+ parser;
23914
+ stack = [
23915
+ new ExpressionScope(),
23916
+ ];
23954
23917
  constructor(parser) {
23955
- __publicField(this, 'parser');
23956
- __publicField(this, 'stack', [new ExpressionScope()]);
23957
23918
  this.parser = parser;
23958
23919
  }
23959
23920
 
@@ -24343,18 +24304,15 @@ var UtilParser = class extends Tokenizer {
24343
24304
  };
24344
24305
 
24345
24306
  var ExpressionErrors = class {
24346
- constructor() {
24347
- __publicField(this, 'shorthandAssignLoc', null);
24348
- __publicField(this, 'doubleProtoLoc', null);
24349
- __publicField(this, 'privateKeyLoc', null);
24350
- __publicField(this, 'optionalParametersLoc', null);
24351
- __publicField(this, 'voidPatternLoc', null);
24352
- }
24307
+ shorthandAssignLoc = null;
24308
+ doubleProtoLoc = null;
24309
+ privateKeyLoc = null;
24310
+ optionalParametersLoc = null;
24311
+ voidPatternLoc = null;
24353
24312
  };
24354
24313
 
24355
24314
  var Node = class {
24356
24315
  constructor(parser, pos, loc) {
24357
- __publicField(this, 'type', '');
24358
24316
  this.start = pos;
24359
24317
  this.end = 0;
24360
24318
  this.loc = new SourceLocation(loc);
@@ -24365,6 +24323,8 @@ var Node = class {
24365
24323
  if (parser?.filename)
24366
24324
  this.loc.filename = parser.filename;
24367
24325
  }
24326
+
24327
+ type = '';
24368
24328
  };
24369
24329
 
24370
24330
  var NodePrototype = Node.prototype;
@@ -24816,7 +24776,7 @@ var LValParser = class extends NodeUtils {
24816
24776
  }
24817
24777
 
24818
24778
  parseMaybeDefault(startLoc, left) {
24819
- startLoc ?? (startLoc = this.state.startLoc);
24779
+ startLoc ??= this.state.startLoc;
24820
24780
  left = left ?? this.parseBindingAtom();
24821
24781
 
24822
24782
  if (!this.eat(25))
@@ -24913,7 +24873,8 @@ var LValParser = class extends NodeUtils {
24913
24873
  }
24914
24874
 
24915
24875
  const unwrappedExpression = unwrapParenthesizedExpression(expression2);
24916
- disallowCallExpression || (disallowCallExpression = unwrappedExpression.type === 'CallExpression' && (unwrappedExpression.callee.type === 'Import' || unwrappedExpression.callee.type === 'Super'));
24876
+
24877
+ disallowCallExpression ||= unwrappedExpression.type === 'CallExpression' && (unwrappedExpression.callee.type === 'Import' || unwrappedExpression.callee.type === 'Super');
24917
24878
  const validity = this.isValidLVal(type, disallowCallExpression, !(hasParenthesizedAncestor || expression2.extra?.parenthesized) && ancestor.type === 'AssignmentExpression', binding);
24918
24879
 
24919
24880
  if (validity === true)
@@ -25160,46 +25121,6 @@ function tsIsEntityName(node) {
25160
25121
  }
25161
25122
 
25162
25123
  var typescript = (superClass) => class TypeScriptParserMixin extends superClass {
25163
- constructor() {
25164
- super(...arguments);
25165
- __publicField(this, 'tsParseInOutModifiers', this.tsParseModifiers.bind(this, {
25166
- allowedModifiers: ['in', 'out'],
25167
- disallowedModifiers: [
25168
- 'const',
25169
- 'public',
25170
- 'private',
25171
- 'protected',
25172
- 'readonly',
25173
- 'declare',
25174
- 'abstract',
25175
- 'override',
25176
- ],
25177
- errorTemplate: TSErrors.InvalidModifierOnTypeParameter,
25178
- }));
25179
- __publicField(this, 'tsParseConstModifier', this.tsParseModifiers.bind(this, {
25180
- allowedModifiers: ['const'],
25181
- disallowedModifiers: ['in', 'out'],
25182
- errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions,
25183
- }));
25184
- __publicField(this, 'tsParseInOutConstModifiers', this.tsParseModifiers.bind(this, {
25185
- allowedModifiers: [
25186
- 'in',
25187
- 'out',
25188
- 'const',
25189
- ],
25190
- disallowedModifiers: [
25191
- 'public',
25192
- 'private',
25193
- 'protected',
25194
- 'readonly',
25195
- 'declare',
25196
- 'abstract',
25197
- 'override',
25198
- ],
25199
- errorTemplate: TSErrors.InvalidModifierOnTypeParameter,
25200
- }));
25201
- }
25202
-
25203
25124
  getScopeHandler() {
25204
25125
  return TypeScriptScopeHandler;
25205
25126
  }
@@ -25574,6 +25495,42 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
25574
25495
  return this.finishNode(node, 'TSTypeQuery');
25575
25496
  }
25576
25497
 
25498
+ tsParseInOutModifiers = this.tsParseModifiers.bind(this, {
25499
+ allowedModifiers: ['in', 'out'],
25500
+ disallowedModifiers: [
25501
+ 'const',
25502
+ 'public',
25503
+ 'private',
25504
+ 'protected',
25505
+ 'readonly',
25506
+ 'declare',
25507
+ 'abstract',
25508
+ 'override',
25509
+ ],
25510
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameter,
25511
+ });
25512
+ tsParseConstModifier = this.tsParseModifiers.bind(this, {
25513
+ allowedModifiers: ['const'],
25514
+ disallowedModifiers: ['in', 'out'],
25515
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions,
25516
+ });
25517
+ tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {
25518
+ allowedModifiers: [
25519
+ 'in',
25520
+ 'out',
25521
+ 'const',
25522
+ ],
25523
+ disallowedModifiers: [
25524
+ 'public',
25525
+ 'private',
25526
+ 'protected',
25527
+ 'readonly',
25528
+ 'declare',
25529
+ 'abstract',
25530
+ 'override',
25531
+ ],
25532
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameter,
25533
+ });
25577
25534
  tsParseTypeParameter(parseModifiers) {
25578
25535
  const node = this.startNode();
25579
25536
  parseModifiers(node);
@@ -25898,7 +25855,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
25898
25855
  this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode);
25899
25856
  }
25900
25857
 
25901
- seenOptionalElement || (seenOptionalElement = type === 'TSNamedTupleMember' && elementNode.optional || type === 'TSOptionalType');
25858
+ seenOptionalElement ||= type === 'TSNamedTupleMember' && elementNode.optional || type === 'TSOptionalType';
25902
25859
  });
25903
25860
  return this.finishNode(node, 'TSTupleType');
25904
25861
  }
@@ -28418,7 +28375,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
28418
28375
  fillOptionalPropertiesForTSESLint(node) {
28419
28376
  switch(node.type) {
28420
28377
  case 'ExpressionStatement':
28421
- node.directive ?? (node.directive = void 0);
28378
+ node.directive ??= void 0;
28422
28379
  return;
28423
28380
 
28424
28381
  case 'RestElement':
@@ -28428,17 +28385,17 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
28428
28385
  case 'ArrayPattern':
28429
28386
  case 'AssignmentPattern':
28430
28387
  case 'ObjectPattern':
28431
- node.decorators ?? (node.decorators = []);
28432
- node.optional ?? (node.optional = false);
28433
- node.typeAnnotation ?? (node.typeAnnotation = void 0);
28388
+ node.decorators ??= [];
28389
+ node.optional ??= false;
28390
+ node.typeAnnotation ??= void 0;
28434
28391
  return;
28435
28392
 
28436
28393
  case 'TSParameterProperty':
28437
- node.accessibility ?? (node.accessibility = void 0);
28438
- node.decorators ?? (node.decorators = []);
28439
- node.override ?? (node.override = false);
28440
- node.readonly ?? (node.readonly = false);
28441
- node.static ?? (node.static = false);
28394
+ node.accessibility ??= void 0;
28395
+ node.decorators ??= [];
28396
+ node.override ??= false;
28397
+ node.readonly ??= false;
28398
+ node.static ??= false;
28442
28399
  return;
28443
28400
 
28444
28401
  case 'TSEmptyBodyFunctionExpression':
@@ -28449,97 +28406,97 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
28449
28406
  case 'FunctionExpression':
28450
28407
  case 'ClassMethod':
28451
28408
  case 'ClassPrivateMethod':
28452
- node.declare ?? (node.declare = false);
28453
- node.returnType ?? (node.returnType = void 0);
28454
- node.typeParameters ?? (node.typeParameters = void 0);
28409
+ node.declare ??= false;
28410
+ node.returnType ??= void 0;
28411
+ node.typeParameters ??= void 0;
28455
28412
  return;
28456
28413
 
28457
28414
  case 'Property':
28458
- node.optional ?? (node.optional = false);
28415
+ node.optional ??= false;
28459
28416
  return;
28460
28417
 
28461
28418
  case 'TSMethodSignature':
28462
28419
  case 'TSPropertySignature':
28463
- node.optional ?? (node.optional = false);
28420
+ node.optional ??= false;
28464
28421
 
28465
28422
  case 'TSIndexSignature':
28466
- node.accessibility ?? (node.accessibility = void 0);
28467
- node.readonly ?? (node.readonly = false);
28468
- node.static ?? (node.static = false);
28423
+ node.accessibility ??= void 0;
28424
+ node.readonly ??= false;
28425
+ node.static ??= false;
28469
28426
  return;
28470
28427
 
28471
28428
  case 'TSAbstractPropertyDefinition':
28472
28429
  case 'PropertyDefinition':
28473
28430
  case 'TSAbstractAccessorProperty':
28474
28431
  case 'AccessorProperty':
28475
- node.declare ?? (node.declare = false);
28476
- node.definite ?? (node.definite = false);
28477
- node.readonly ?? (node.readonly = false);
28478
- node.typeAnnotation ?? (node.typeAnnotation = void 0);
28432
+ node.declare ??= false;
28433
+ node.definite ??= false;
28434
+ node.readonly ??= false;
28435
+ node.typeAnnotation ??= void 0;
28479
28436
 
28480
28437
  case 'TSAbstractMethodDefinition':
28481
28438
  case 'MethodDefinition':
28482
- node.accessibility ?? (node.accessibility = void 0);
28483
- node.decorators ?? (node.decorators = []);
28484
- node.override ?? (node.override = false);
28485
- node.optional ?? (node.optional = false);
28439
+ node.accessibility ??= void 0;
28440
+ node.decorators ??= [];
28441
+ node.override ??= false;
28442
+ node.optional ??= false;
28486
28443
  return;
28487
28444
 
28488
28445
  case 'ClassExpression':
28489
- node.id ?? (node.id = null);
28446
+ node.id ??= null;
28490
28447
 
28491
28448
  case 'ClassDeclaration':
28492
- node.abstract ?? (node.abstract = false);
28493
- node.declare ?? (node.declare = false);
28494
- node.decorators ?? (node.decorators = []);
28495
- node.implements ?? (node.implements = []);
28496
- node.superTypeArguments ?? (node.superTypeArguments = void 0);
28497
- node.typeParameters ?? (node.typeParameters = void 0);
28449
+ node.abstract ??= false;
28450
+ node.declare ??= false;
28451
+ node.decorators ??= [];
28452
+ node.implements ??= [];
28453
+ node.superTypeArguments ??= void 0;
28454
+ node.typeParameters ??= void 0;
28498
28455
  return;
28499
28456
 
28500
28457
  case 'TSTypeAliasDeclaration':
28501
28458
  case 'VariableDeclaration':
28502
- node.declare ?? (node.declare = false);
28459
+ node.declare ??= false;
28503
28460
  return;
28504
28461
 
28505
28462
  case 'VariableDeclarator':
28506
- node.definite ?? (node.definite = false);
28463
+ node.definite ??= false;
28507
28464
  return;
28508
28465
 
28509
28466
  case 'TSEnumDeclaration':
28510
- node.const ?? (node.const = false);
28511
- node.declare ?? (node.declare = false);
28467
+ node.const ??= false;
28468
+ node.declare ??= false;
28512
28469
  return;
28513
28470
 
28514
28471
  case 'TSEnumMember':
28515
- node.computed ?? (node.computed = false);
28472
+ node.computed ??= false;
28516
28473
  return;
28517
28474
 
28518
28475
  case 'TSImportType':
28519
- node.qualifier ?? (node.qualifier = null);
28520
- node.options ?? (node.options = null);
28521
- node.typeArguments ?? (node.typeArguments = null);
28476
+ node.qualifier ??= null;
28477
+ node.options ??= null;
28478
+ node.typeArguments ??= null;
28522
28479
  return;
28523
28480
 
28524
28481
  case 'TSInterfaceDeclaration':
28525
- node.declare ?? (node.declare = false);
28526
- node.extends ?? (node.extends = []);
28482
+ node.declare ??= false;
28483
+ node.extends ??= [];
28527
28484
  return;
28528
28485
 
28529
28486
  case 'TSMappedType':
28530
- node.optional ?? (node.optional = false);
28531
- node.readonly ?? (node.readonly = void 0);
28487
+ node.optional ??= false;
28488
+ node.readonly ??= void 0;
28532
28489
  return;
28533
28490
 
28534
28491
  case 'TSModuleDeclaration':
28535
- node.declare ?? (node.declare = false);
28536
- node.global ?? (node.global = node.kind === 'global');
28492
+ node.declare ??= false;
28493
+ node.global ??= node.kind === 'global';
28537
28494
  return;
28538
28495
 
28539
28496
  case 'TSTypeParameter':
28540
- node.const ?? (node.const = false);
28541
- node.in ?? (node.in = false);
28542
- node.out ?? (node.out = false);
28497
+ node.const ??= false;
28498
+ node.in ??= false;
28499
+ node.out ??= false;
28543
28500
  return;
28544
28501
  }
28545
28502
  }
@@ -32774,7 +32731,7 @@ var StatementParser = class extends ExpressionParser {
32774
32731
 
32775
32732
  maybeParseExportNamespaceSpecifier(node) {
32776
32733
  if (this.isContextual(89)) {
32777
- node.specifiers ?? (node.specifiers = []);
32734
+ node.specifiers ??= [];
32778
32735
  const specifier = this.startNodeAt(this.state.lastTokStartLoc);
32779
32736
  this.next();
32780
32737
  specifier.exported = this.parseModuleExportName();
@@ -33181,7 +33138,7 @@ var StatementParser = class extends ExpressionParser {
33181
33138
  }
33182
33139
 
33183
33140
  parseImportSourceAndAttributes(node) {
33184
- node.specifiers ?? (node.specifiers = []);
33141
+ node.specifiers ??= [];
33185
33142
  node.source = this.parseImportSource();
33186
33143
  this.maybeParseImportAttributes(node);
33187
33144
  this.checkImportPhase(node);
@@ -36056,14 +36013,14 @@ function addMappingInternal(skipable, map, mapping) {
36056
36013
  var import_jsesc = __toESM(require_jsesc(), 1);
36057
36014
 
36058
36015
  var SourceMap = class {
36016
+ _map;
36017
+ _rawMappings;
36018
+ _sourceFileName;
36019
+ _lastGenLine = 0;
36020
+ _lastSourceLine = 0;
36021
+ _lastSourceColumn = 0;
36022
+ _inputMap = null;
36059
36023
  constructor(opts, code2) {
36060
- __publicField(this, '_map');
36061
- __publicField(this, '_rawMappings');
36062
- __publicField(this, '_sourceFileName');
36063
- __publicField(this, '_lastGenLine', 0);
36064
- __publicField(this, '_lastSourceLine', 0);
36065
- __publicField(this, '_lastSourceColumn', 0);
36066
- __publicField(this, '_inputMap', null);
36067
36024
  const map = this._map = new GenMapping({
36068
36025
  sourceRoot: opts.sourceRoot,
36069
36026
  });
@@ -36100,7 +36057,7 @@ var SourceMap = class {
36100
36057
  }
36101
36058
 
36102
36059
  getRawMappings() {
36103
- return this._rawMappings || (this._rawMappings = allMappings(this._map));
36060
+ return this._rawMappings ||= allMappings(this._map);
36104
36061
  }
36105
36062
 
36106
36063
  mark(generated, line, column, identifierName, identifierNamePos, filename) {
@@ -36142,27 +36099,6 @@ var SourceMap = class {
36142
36099
 
36143
36100
  var Buffer2 = class {
36144
36101
  constructor(map, indentChar) {
36145
- __publicField(this, '_map', null);
36146
- __publicField(this, '_buf', '');
36147
- __publicField(this, '_str', '');
36148
- __publicField(this, '_appendCount', 0);
36149
- __publicField(this, '_last', 0);
36150
- __publicField(this, '_queue', []);
36151
- __publicField(this, '_queueCursor', 0);
36152
- __publicField(this, '_canMarkIdName', true);
36153
- __publicField(this, '_indentChar', '');
36154
- __publicField(this, '_fastIndentations', []);
36155
- __publicField(this, '_position', {
36156
- line: 1,
36157
- column: 0,
36158
- });
36159
- __publicField(this, '_sourcePosition', {
36160
- identifierName: void 0,
36161
- identifierNamePos: void 0,
36162
- line: void 0,
36163
- column: void 0,
36164
- filename: void 0,
36165
- });
36166
36102
  this._map = map;
36167
36103
  this._indentChar = indentChar;
36168
36104
  for (let i = 0; i < 64; i++) {
@@ -36172,6 +36108,27 @@ var Buffer2 = class {
36172
36108
  this._allocQueue();
36173
36109
  }
36174
36110
 
36111
+ _map = null;
36112
+ _buf = '';
36113
+ _str = '';
36114
+ _appendCount = 0;
36115
+ _last = 0;
36116
+ _queue = [];
36117
+ _queueCursor = 0;
36118
+ _canMarkIdName = true;
36119
+ _indentChar = '';
36120
+ _fastIndentations = [];
36121
+ _position = {
36122
+ line: 1,
36123
+ column: 0,
36124
+ };
36125
+ _sourcePosition = {
36126
+ identifierName: void 0,
36127
+ identifierNamePos: void 0,
36128
+ line: void 0,
36129
+ column: void 0,
36130
+ filename: void 0,
36131
+ };
36175
36132
  _allocQueue() {
36176
36133
  const queue = this._queue;
36177
36134
 
@@ -37288,12 +37245,12 @@ var n = /* @__PURE__ */Object.freeze({
37288
37245
  var {traverseFast: traverseFast2, VISITOR_KEYS: VISITOR_KEYS2} = lib_exports;
37289
37246
 
37290
37247
  var TokenMap = class {
37248
+ _tokens;
37249
+ _source;
37250
+ _nodesToTokenIndexes = /* @__PURE__ */new Map();
37251
+ _nodesOccurrencesCountCache = /* @__PURE__ */new Map();
37252
+ _tokensCache = /* @__PURE__ */new Map();
37291
37253
  constructor(ast, tokens, source) {
37292
- __publicField(this, '_tokens');
37293
- __publicField(this, '_source');
37294
- __publicField(this, '_nodesToTokenIndexes', /* @__PURE__ */new Map());
37295
- __publicField(this, '_nodesOccurrencesCountCache', /* @__PURE__ */new Map());
37296
- __publicField(this, '_tokensCache', /* @__PURE__ */new Map());
37297
37254
  this._tokens = tokens;
37298
37255
  this._source = source;
37299
37256
  traverseFast2(ast, (node) => {
@@ -40047,8 +40004,8 @@ function TSTypeParameterInstantiation2(node, parent) {
40047
40004
  let printTrailingSeparator = parent.type === 'ArrowFunctionExpression' && node.params.length === 1;
40048
40005
 
40049
40006
  if (this.tokenMap && node.start != null && node.end != null) {
40050
- printTrailingSeparator && (printTrailingSeparator = !!this.tokenMap.find(node, (t) => this.tokenMap.matchesOriginal(t, ',')));
40051
- printTrailingSeparator || (printTrailingSeparator = this.shouldPrintTrailingComma('>'));
40007
+ printTrailingSeparator &&= !!this.tokenMap.find(node, (t) => this.tokenMap.matchesOriginal(t, ','));
40008
+ printTrailingSeparator ||= this.shouldPrintTrailingComma('>');
40052
40009
  }
40053
40010
 
40054
40011
  this.printList(node.params, printTrailingSeparator);
@@ -41075,27 +41032,6 @@ var {needsParens} = n;
41075
41032
 
41076
41033
  var Printer = class {
41077
41034
  constructor(format, map, tokens = null, originalCode = null) {
41078
- __publicField(this, 'tokenContext', TokenContext.normal);
41079
- __publicField(this, '_tokens', null);
41080
- __publicField(this, '_originalCode', null);
41081
- __publicField(this, '_currentNode', null);
41082
- __publicField(this, '_indent', 0);
41083
- __publicField(this, '_indentRepeat', 0);
41084
- __publicField(this, '_insideAux', false);
41085
- __publicField(this, '_noLineTerminator', false);
41086
- __publicField(this, '_noLineTerminatorAfterNode', null);
41087
- __publicField(this, '_printAuxAfterOnNextUserNode', false);
41088
- __publicField(this, '_printedComments', /* @__PURE__ */new Set());
41089
- __publicField(this, '_endsWithInteger', false);
41090
- __publicField(this, '_endsWithWord', false);
41091
- __publicField(this, '_endsWithDiv', false);
41092
- __publicField(this, '_lastCommentLine', 0);
41093
- __publicField(this, '_endsWithInnerRaw', false);
41094
- __publicField(this, '_indentInnerComments', true);
41095
- __publicField(this, 'tokenMap', null);
41096
- __publicField(this, '_boundGetRawIdentifier', this._getRawIdentifier.bind(this));
41097
- __publicField(this, '_printSemicolonBeforeNextNode', -1);
41098
- __publicField(this, '_printSemicolonBeforeNextToken', -1);
41099
41035
  this.format = format;
41100
41036
  this._tokens = tokens;
41101
41037
  this._originalCode = originalCode;
@@ -41135,6 +41071,25 @@ var Printer = class {
41135
41071
  };
41136
41072
  }
41137
41073
 
41074
+ tokenContext = TokenContext.normal;
41075
+ _tokens = null;
41076
+ _originalCode = null;
41077
+ _currentNode = null;
41078
+ _indent = 0;
41079
+ _indentRepeat = 0;
41080
+ _insideAux = false;
41081
+ _noLineTerminator = false;
41082
+ _noLineTerminatorAfterNode = null;
41083
+ _printAuxAfterOnNextUserNode = false;
41084
+ _printedComments = /* @__PURE__ */new Set();
41085
+ _endsWithInteger = false;
41086
+ _endsWithWord = false;
41087
+ _endsWithDiv = false;
41088
+ _lastCommentLine = 0;
41089
+ _endsWithInnerRaw = false;
41090
+ _indentInnerComments = true;
41091
+ tokenMap = null;
41092
+ _boundGetRawIdentifier = this._getRawIdentifier.bind(this);
41138
41093
  generate(ast) {
41139
41094
  if (this.format.preserveFormat) {
41140
41095
  this.tokenMap = new TokenMap(ast, this._tokens, this._originalCode);
@@ -41165,6 +41120,8 @@ var Printer = class {
41165
41120
  this._indent--;
41166
41121
  }
41167
41122
 
41123
+ _printSemicolonBeforeNextNode = -1;
41124
+ _printSemicolonBeforeNextToken = -1;
41168
41125
  semicolon(force = false) {
41169
41126
  this._maybeAddAuxComment();
41170
41127
 
@@ -41559,7 +41516,7 @@ var Printer = class {
41559
41516
  let oldTokenContext;
41560
41517
 
41561
41518
  if (!shouldPrintParens) {
41562
- noLineTerminatorAfter || (noLineTerminatorAfter = !!parent && this._noLineTerminatorAfterNode === parent && isLastChild(parent, node));
41519
+ noLineTerminatorAfter ||= !!parent && this._noLineTerminatorAfterNode === parent && isLastChild(parent, node);
41563
41520
 
41564
41521
  if (noLineTerminatorAfter) {
41565
41522
  if (node.trailingComments?.some(commentIsNewline)) {
@@ -42230,21 +42187,20 @@ function enable(namespaces$1) {
42230
42187
  }
42231
42188
 
42232
42189
  // ../babel-babel/node_modules/obug/dist/node.js
42233
- var import_node_util = {
42234
- formatWithOptions: () => false,
42235
- inspect: () => false,
42236
- };
42190
+ var isatty = () => false;
42237
42191
 
42238
42192
  var colors = [];
42239
42193
 
42240
42194
  var inspectOpts = {};
42241
42195
 
42242
- function useColors() {}
42196
+ function useColors() {
42197
+ return 'colors' in inspectOpts ? Boolean(inspectOpts.colors) : isatty(process.stderr.fd);
42198
+ }
42243
42199
 
42244
42200
  function formatArgs() {}
42245
42201
 
42246
42202
  function log(...args) {
42247
- process.stderr.write(`${(0, import_node_util.formatWithOptions)(this.inspectOpts, ...args)}
42203
+ process.stderr.write(`${formatWithOptions(this.inspectOpts, ...args)}
42248
42204
  `);
42249
42205
  }
42250
42206
 
@@ -42254,7 +42210,7 @@ var defaultOptions = {
42254
42210
  formatters: {
42255
42211
  o(v) {
42256
42212
  this.inspectOpts.colors = this.useColors;
42257
- return (0, import_node_util.inspect)(v, this
42213
+ return inspect(v, this
42258
42214
  .inspectOpts)
42259
42215
  .split('\n')
42260
42216
  .map((str) => str.trim())
@@ -42262,7 +42218,7 @@ var defaultOptions = {
42262
42218
  },
42263
42219
  O(v) {
42264
42220
  this.inspectOpts.colors = this.useColors;
42265
- return (0, import_node_util.inspect)(v, this.inspectOpts);
42221
+ return inspect(v, this.inspectOpts);
42266
42222
  },
42267
42223
  },
42268
42224
  inspectOpts,
@@ -42644,7 +42600,7 @@ function explode$1(visitor) {
42644
42600
 
42645
42601
  if (types2 !== null) {
42646
42602
  for (const type of types2) {
42647
- visitor[type] ?? (visitor[type] = {});
42603
+ visitor[type] ??= {};
42648
42604
  mergePair(visitor[type], fns);
42649
42605
  }
42650
42606
  } else {
@@ -42768,7 +42724,7 @@ function merge2(visitors2, states = [], wrapper) {
42768
42724
  typeVisitor = wrapWithStateOrWrapper(typeVisitor, state, wrapper);
42769
42725
  }
42770
42726
 
42771
- const nodeVisitor = mergedVisitor[key] || (mergedVisitor[key] = {});
42727
+ const nodeVisitor = mergedVisitor[key] ||= {};
42772
42728
  mergePair(nodeVisitor, typeVisitor);
42773
42729
  }
42774
42730
  }
@@ -42917,6 +42873,10 @@ var renameVisitor = {
42917
42873
  if (path.isMethod()) {
42918
42874
  path.requeueComputedKeyAndDecorators();
42919
42875
  }
42876
+
42877
+ if (path.isSwitchStatement()) {
42878
+ path.context.maybeQueue(path.get('discriminant'));
42879
+ }
42920
42880
  }
42921
42881
  },
42922
42882
  ObjectProperty({node, scope: scope2}, state) {
@@ -43091,16 +43051,11 @@ function traverseForScope(path, visitors2, state) {
43091
43051
  }
43092
43052
 
43093
43053
  var Binding = class {
43054
+ identifier;
43055
+ scope;
43056
+ path;
43057
+ kind;
43094
43058
  constructor({identifier: identifier4, scope: scope2, path, kind}) {
43095
- __publicField(this, 'identifier');
43096
- __publicField(this, 'scope');
43097
- __publicField(this, 'path');
43098
- __publicField(this, 'kind');
43099
- __publicField(this, 'constantViolations', []);
43100
- __publicField(this, 'constant', true);
43101
- __publicField(this, 'referencePaths', []);
43102
- __publicField(this, 'referenced', false);
43103
- __publicField(this, 'references', 0);
43104
43059
  this.identifier = identifier4;
43105
43060
  this.scope = scope2;
43106
43061
  this.path = path;
@@ -43113,6 +43068,11 @@ var Binding = class {
43113
43068
  this.clearValue();
43114
43069
  }
43115
43070
 
43071
+ constantViolations = [];
43072
+ constant = true;
43073
+ referencePaths = [];
43074
+ referenced = false;
43075
+ references = 0;
43116
43076
  deoptValue() {
43117
43077
  this.clearValue();
43118
43078
  this.hasDeoptedValue = true;
@@ -43200,7 +43160,7 @@ function getCachedPaths(path) {
43200
43160
 
43201
43161
  function getOrCreateCachedPaths(node, parentPath) {
43202
43162
  if (parentPath) {
43203
- return parentPath._store || (parentPath._store = /* @__PURE__ */new Map());
43163
+ return parentPath._store ||= /* @__PURE__ */new Map();
43204
43164
  }
43205
43165
 
43206
43166
  let paths = pathsCache.get(node);
@@ -43571,19 +43531,19 @@ var collectorVisitor = {
43571
43531
  var scopeVisitor;
43572
43532
  var uid = 0;
43573
43533
 
43574
- var _Scope = class _Scope {
43534
+ var Scope2 = class _Scope {
43535
+ uid;
43536
+ path;
43537
+ block;
43538
+ inited;
43539
+ labels;
43540
+ bindings;
43541
+ referencesSet;
43542
+ globals;
43543
+ uidsSet;
43544
+ data;
43545
+ crawling;
43575
43546
  constructor(path) {
43576
- __publicField(this, 'uid');
43577
- __publicField(this, 'path');
43578
- __publicField(this, 'block');
43579
- __publicField(this, 'inited');
43580
- __publicField(this, 'labels');
43581
- __publicField(this, 'bindings');
43582
- __publicField(this, 'referencesSet');
43583
- __publicField(this, 'globals');
43584
- __publicField(this, 'uidsSet');
43585
- __publicField(this, 'data');
43586
- __publicField(this, 'crawling');
43587
43547
  const {node} = path;
43588
43548
 
43589
43549
  const cached = scope.get(node);
@@ -43600,6 +43560,16 @@ var _Scope = class _Scope {
43600
43560
  this.inited = false;
43601
43561
  }
43602
43562
 
43563
+ static globals = [
43564
+ ...builtin_lower_default,
43565
+ ...builtin_upper_default,
43566
+ ];
43567
+ static contextVariables = [
43568
+ 'arguments',
43569
+ 'undefined',
43570
+ 'Infinity',
43571
+ 'NaN',
43572
+ ];
43603
43573
  get parent() {
43604
43574
  let parent, path = this.path;
43605
43575
 
@@ -43737,7 +43707,7 @@ var _Scope = class _Scope {
43737
43707
  const binding = this.getBinding(oldName);
43738
43708
 
43739
43709
  if (binding) {
43740
- newName || (newName = this.generateUidIdentifier(oldName).name);
43710
+ newName ||= this.generateUidIdentifier(oldName).name;
43741
43711
  const renamer = new Renamer(binding, oldName, newName);
43742
43712
  renamer.rename();
43743
43713
  }
@@ -44076,12 +44046,12 @@ var _Scope = class _Scope {
44076
44046
  };
44077
44047
 
44078
44048
  this.crawling = true;
44079
- scopeVisitor || (scopeVisitor = traverse3.visitors.merge([{
44049
+ scopeVisitor ||= traverse3.visitors.merge([{
44080
44050
  Scope(path2) {
44081
44051
  resetScope(path2.scope);
44082
44052
  },
44083
44053
  },
44084
- collectorVisitor]));
44054
+ collectorVisitor]);
44085
44055
 
44086
44056
  if (path.type !== 'Program') {
44087
44057
  const typeVisitors = scopeVisitor[path.type];
@@ -44370,7 +44340,7 @@ collectorVisitor]));
44370
44340
  const init = [];
44371
44341
 
44372
44342
  for (const decl of parent.declarations) {
44373
- firstId ?? (firstId = decl.id);
44343
+ firstId ??= decl.id;
44374
44344
 
44375
44345
  if (decl.init) {
44376
44346
  init.push(assignmentExpression$3('=', decl.id, decl.init));
@@ -44400,15 +44370,6 @@ collectorVisitor]));
44400
44370
  }
44401
44371
  };
44402
44372
 
44403
- __publicField(_Scope, 'globals', [...builtin_lower_default, ...builtin_upper_default]);
44404
- __publicField(_Scope, 'contextVariables', [
44405
- 'arguments',
44406
- 'undefined',
44407
- 'Infinity',
44408
- 'NaN',
44409
- ]);
44410
- var Scope2 = _Scope;
44411
-
44412
44373
  var {VISITOR_KEYS: VISITOR_KEYS$4} = lib_exports;
44413
44374
 
44414
44375
  function findParent(callback) {
@@ -46552,7 +46513,7 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
46552
46513
  let arrowParent;
46553
46514
  let thisEnvFn = fnPath.findParent((p) => {
46554
46515
  if (p.isArrowFunctionExpression()) {
46555
- arrowParent ?? (arrowParent = p);
46516
+ arrowParent ??= p;
46556
46517
  return false;
46557
46518
  }
46558
46519
 
@@ -48088,17 +48049,6 @@ var SHOULD_SKIP = 1 << 2;
48088
48049
 
48089
48050
  var NodePath_Final = class NodePath {
48090
48051
  constructor(hub, parent) {
48091
- __publicField(this, 'contexts', []);
48092
- __publicField(this, 'state', null);
48093
- __publicField(this, '_traverseFlags', 0);
48094
- __publicField(this, 'skipKeys', null);
48095
- __publicField(this, 'parentPath', null);
48096
- __publicField(this, 'container', null);
48097
- __publicField(this, 'listKey', null);
48098
- __publicField(this, 'key', null);
48099
- __publicField(this, 'node', null);
48100
- __publicField(this, 'type', null);
48101
- __publicField(this, '_store', null);
48102
48052
  this.parent = parent;
48103
48053
  this.hub = hub;
48104
48054
  this.data = null;
@@ -48106,6 +48056,9 @@ var NodePath_Final = class NodePath {
48106
48056
  this.scope = null;
48107
48057
  }
48108
48058
 
48059
+ contexts = [];
48060
+ state = null;
48061
+ _traverseFlags = 0;
48109
48062
  get removed() {
48110
48063
  return (this._traverseFlags & 1) > 0;
48111
48064
  }
@@ -48139,6 +48092,14 @@ var NodePath_Final = class NodePath {
48139
48092
  this._traverseFlags &= -5;
48140
48093
  }
48141
48094
 
48095
+ skipKeys = null;
48096
+ parentPath = null;
48097
+ container = null;
48098
+ listKey = null;
48099
+ key = null;
48100
+ node = null;
48101
+ type = null;
48102
+ _store = null;
48142
48103
  static get({hub, parentPath, parent, container, listKey, key}) {
48143
48104
  if (!hub && parentPath) {
48144
48105
  hub = parentPath.hub;
@@ -48350,14 +48311,14 @@ var {VISITOR_KEYS: VISITOR_KEYS$2} = lib_exports;
48350
48311
 
48351
48312
  var TraversalContext = class {
48352
48313
  constructor(scope2, opts, state, parentPath) {
48353
- __publicField(this, 'queue', null);
48354
- __publicField(this, 'priorityQueue', null);
48355
48314
  this.parentPath = parentPath;
48356
48315
  this.scope = scope2;
48357
48316
  this.state = state;
48358
48317
  this.opts = opts;
48359
48318
  }
48360
48319
 
48320
+ queue = null;
48321
+ priorityQueue = null;
48361
48322
  shouldVisit(node) {
48362
48323
  const opts = this.opts;
48363
48324
 
@@ -48605,6 +48566,8 @@ function traverseNode(node, opts, scope2, state, path, skipKeys, visitSelf) {
48605
48566
  return _visitPaths(ctx, [path]);
48606
48567
  }
48607
48568
 
48569
+ const hub = path == null ? node.type === 'Program' || node.type === 'File' ? new Hub() : void 0 : path.hub;
48570
+
48608
48571
  for (const key of keys2) {
48609
48572
  if (skipKeys?.[key])
48610
48573
  continue;
@@ -48627,6 +48590,7 @@ function traverseNode(node, opts, scope2, state, path, skipKeys, visitSelf) {
48627
48590
  container: prop,
48628
48591
  key: i,
48629
48592
  listKey: key,
48593
+ hub,
48630
48594
  });
48631
48595
 
48632
48596
  paths.push(childPath);
@@ -48636,7 +48600,7 @@ function traverseNode(node, opts, scope2, state, path, skipKeys, visitSelf) {
48636
48600
  return true;
48637
48601
  } else {
48638
48602
  if (_visitPaths(ctx, [
48639
- NodePath_Final.get({parentPath: path, parent: node, container: node, key, listKey: null}),
48603
+ NodePath_Final.get({parentPath: path, parent: node, container: node, key, listKey: null, hub}),
48640
48604
  ])) {
48641
48605
  return true;
48642
48606
  }
@@ -48934,6 +48898,20 @@ function _getQueueContexts() {
48934
48898
  return contexts;
48935
48899
  }
48936
48900
 
48901
+ var Hub = class {
48902
+ getCode() {}
48903
+
48904
+ getScope() {}
48905
+
48906
+ addHelper() {
48907
+ throw new Error('Helpers are not supported by the default hub.');
48908
+ }
48909
+
48910
+ buildError(node, msg, Error2 = TypeError) {
48911
+ return new Error2(msg);
48912
+ }
48913
+ };
48914
+
48937
48915
  var {
48938
48916
  VISITOR_KEYS: VISITOR_KEYS3,
48939
48917
  removeProperties: removeProperties2,
@@ -48997,14 +48975,13 @@ traverse3.hasType = function(tree, type, denylistTypes) {
48997
48975
  });
48998
48976
  };
48999
48977
  traverse3.cache = cache;
49000
- // Annotate the CommonJS export names for ESM import in node:
49001
- 0 && (module.exports = {
48978
+ export {
49002
48979
  codeFrameColumns,
49003
48980
  generate,
49004
48981
  parse,
49005
48982
  parseExpression,
49006
- template,
48983
+ index as template,
49007
48984
  tokTypes,
49008
- traverse,
49009
- types,
49010
- });
48985
+ traverse3 as traverse,
48986
+ lib_exports as types,
48987
+ };