@typescript-deploys/pr-build 5.0.0-pr-50403-6 → 5.0.0-pr-51682-13

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.
@@ -50,7 +50,7 @@ var path = __toESM(require("path"));
50
50
 
51
51
  // src/compiler/corePublic.ts
52
52
  var versionMajorMinor = "5.0";
53
- var version = `${versionMajorMinor}.0-insiders.20221207`;
53
+ var version = `${versionMajorMinor}.0-insiders.20221208`;
54
54
 
55
55
  // src/compiler/core.ts
56
56
  var emptyArray = [];
@@ -9165,6 +9165,8 @@ function getJSDocTypeTag(node) {
9165
9165
  return void 0;
9166
9166
  }
9167
9167
  function getJSDocTagsWorker(node, noCache) {
9168
+ if (!canHaveJSDoc(node))
9169
+ return emptyArray;
9168
9170
  let tags = node.jsDocCache;
9169
9171
  if (tags === void 0 || noCache) {
9170
9172
  const comments = getJSDocCommentsAndTags(node, noCache);
@@ -9497,6 +9499,114 @@ function isNamedImportBindings(node) {
9497
9499
  const kind = node.kind;
9498
9500
  return kind === 272 /* NamedImports */ || kind === 271 /* NamespaceImport */;
9499
9501
  }
9502
+ function canHaveSymbol(node) {
9503
+ switch (node.kind) {
9504
+ case 216 /* ArrowFunction */:
9505
+ case 223 /* BinaryExpression */:
9506
+ case 205 /* BindingElement */:
9507
+ case 210 /* CallExpression */:
9508
+ case 176 /* CallSignature */:
9509
+ case 260 /* ClassDeclaration */:
9510
+ case 228 /* ClassExpression */:
9511
+ case 172 /* ClassStaticBlockDeclaration */:
9512
+ case 173 /* Constructor */:
9513
+ case 182 /* ConstructorType */:
9514
+ case 177 /* ConstructSignature */:
9515
+ case 209 /* ElementAccessExpression */:
9516
+ case 263 /* EnumDeclaration */:
9517
+ case 302 /* EnumMember */:
9518
+ case 274 /* ExportAssignment */:
9519
+ case 275 /* ExportDeclaration */:
9520
+ case 278 /* ExportSpecifier */:
9521
+ case 259 /* FunctionDeclaration */:
9522
+ case 215 /* FunctionExpression */:
9523
+ case 181 /* FunctionType */:
9524
+ case 174 /* GetAccessor */:
9525
+ case 79 /* Identifier */:
9526
+ case 270 /* ImportClause */:
9527
+ case 268 /* ImportEqualsDeclaration */:
9528
+ case 273 /* ImportSpecifier */:
9529
+ case 178 /* IndexSignature */:
9530
+ case 261 /* InterfaceDeclaration */:
9531
+ case 341 /* JSDocCallbackTag */:
9532
+ case 342 /* JSDocEnumTag */:
9533
+ case 320 /* JSDocFunctionType */:
9534
+ case 343 /* JSDocParameterTag */:
9535
+ case 350 /* JSDocPropertyTag */:
9536
+ case 326 /* JSDocSignature */:
9537
+ case 348 /* JSDocTypedefTag */:
9538
+ case 325 /* JSDocTypeLiteral */:
9539
+ case 288 /* JsxAttribute */:
9540
+ case 289 /* JsxAttributes */:
9541
+ case 290 /* JsxSpreadAttribute */:
9542
+ case 197 /* MappedType */:
9543
+ case 171 /* MethodDeclaration */:
9544
+ case 170 /* MethodSignature */:
9545
+ case 264 /* ModuleDeclaration */:
9546
+ case 199 /* NamedTupleMember */:
9547
+ case 277 /* NamespaceExport */:
9548
+ case 267 /* NamespaceExportDeclaration */:
9549
+ case 271 /* NamespaceImport */:
9550
+ case 211 /* NewExpression */:
9551
+ case 14 /* NoSubstitutionTemplateLiteral */:
9552
+ case 8 /* NumericLiteral */:
9553
+ case 207 /* ObjectLiteralExpression */:
9554
+ case 166 /* Parameter */:
9555
+ case 208 /* PropertyAccessExpression */:
9556
+ case 299 /* PropertyAssignment */:
9557
+ case 169 /* PropertyDeclaration */:
9558
+ case 168 /* PropertySignature */:
9559
+ case 175 /* SetAccessor */:
9560
+ case 300 /* ShorthandPropertyAssignment */:
9561
+ case 308 /* SourceFile */:
9562
+ case 301 /* SpreadAssignment */:
9563
+ case 10 /* StringLiteral */:
9564
+ case 262 /* TypeAliasDeclaration */:
9565
+ case 184 /* TypeLiteral */:
9566
+ case 165 /* TypeParameter */:
9567
+ case 257 /* VariableDeclaration */:
9568
+ return true;
9569
+ default:
9570
+ return false;
9571
+ }
9572
+ }
9573
+ function canHaveLocals(node) {
9574
+ switch (node.kind) {
9575
+ case 216 /* ArrowFunction */:
9576
+ case 238 /* Block */:
9577
+ case 176 /* CallSignature */:
9578
+ case 266 /* CaseBlock */:
9579
+ case 295 /* CatchClause */:
9580
+ case 172 /* ClassStaticBlockDeclaration */:
9581
+ case 191 /* ConditionalType */:
9582
+ case 173 /* Constructor */:
9583
+ case 182 /* ConstructorType */:
9584
+ case 177 /* ConstructSignature */:
9585
+ case 245 /* ForStatement */:
9586
+ case 246 /* ForInStatement */:
9587
+ case 247 /* ForOfStatement */:
9588
+ case 259 /* FunctionDeclaration */:
9589
+ case 215 /* FunctionExpression */:
9590
+ case 181 /* FunctionType */:
9591
+ case 174 /* GetAccessor */:
9592
+ case 178 /* IndexSignature */:
9593
+ case 341 /* JSDocCallbackTag */:
9594
+ case 342 /* JSDocEnumTag */:
9595
+ case 320 /* JSDocFunctionType */:
9596
+ case 326 /* JSDocSignature */:
9597
+ case 348 /* JSDocTypedefTag */:
9598
+ case 197 /* MappedType */:
9599
+ case 171 /* MethodDeclaration */:
9600
+ case 170 /* MethodSignature */:
9601
+ case 264 /* ModuleDeclaration */:
9602
+ case 175 /* SetAccessor */:
9603
+ case 308 /* SourceFile */:
9604
+ case 262 /* TypeAliasDeclaration */:
9605
+ return true;
9606
+ default:
9607
+ return false;
9608
+ }
9609
+ }
9500
9610
  function isDeclarationKind(kind) {
9501
9611
  return kind === 216 /* ArrowFunction */ || kind === 205 /* BindingElement */ || kind === 260 /* ClassDeclaration */ || kind === 228 /* ClassExpression */ || kind === 172 /* ClassStaticBlockDeclaration */ || kind === 173 /* Constructor */ || kind === 263 /* EnumDeclaration */ || kind === 302 /* EnumMember */ || kind === 278 /* ExportSpecifier */ || kind === 259 /* FunctionDeclaration */ || kind === 215 /* FunctionExpression */ || kind === 174 /* GetAccessor */ || kind === 270 /* ImportClause */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 273 /* ImportSpecifier */ || kind === 261 /* InterfaceDeclaration */ || kind === 288 /* JsxAttribute */ || kind === 171 /* MethodDeclaration */ || kind === 170 /* MethodSignature */ || kind === 264 /* ModuleDeclaration */ || kind === 267 /* NamespaceExportDeclaration */ || kind === 271 /* NamespaceImport */ || kind === 277 /* NamespaceExport */ || kind === 166 /* Parameter */ || kind === 299 /* PropertyAssignment */ || kind === 169 /* PropertyDeclaration */ || kind === 168 /* PropertySignature */ || kind === 175 /* SetAccessor */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 262 /* TypeAliasDeclaration */ || kind === 165 /* TypeParameter */ || kind === 257 /* VariableDeclaration */ || kind === 348 /* JSDocTypedefTag */ || kind === 341 /* JSDocCallbackTag */ || kind === 350 /* JSDocPropertyTag */;
9502
9612
  }
@@ -9564,6 +9674,8 @@ function isJSDocNode(node) {
9564
9674
  return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 350 /* LastJSDocNode */;
9565
9675
  }
9566
9676
  function hasJSDocNodes(node) {
9677
+ if (!canHaveJSDoc(node))
9678
+ return false;
9567
9679
  const { jsDoc } = node;
9568
9680
  return !!jsDoc && jsDoc.length > 0;
9569
9681
  }
@@ -9613,11 +9725,7 @@ function createSingleLineStringWriter() {
9613
9725
  writeLine: () => str += " ",
9614
9726
  increaseIndent: noop,
9615
9727
  decreaseIndent: noop,
9616
- clear: () => str = "",
9617
- trackSymbol: () => false,
9618
- reportInaccessibleThisError: noop,
9619
- reportInaccessibleUniqueSymbolError: noop,
9620
- reportPrivateInBaseOfClassExpression: noop
9728
+ clear: () => str = ""
9621
9729
  };
9622
9730
  }
9623
9731
  function copyEntries(source, target) {
@@ -9940,7 +10048,7 @@ function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
9940
10048
  function getContainingClass(node) {
9941
10049
  return findAncestor(node.parent, isClassLike);
9942
10050
  }
9943
- function getThisContainer(node, includeArrowFunctions) {
10051
+ function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) {
9944
10052
  Debug.assert(node.kind !== 308 /* SourceFile */);
9945
10053
  while (true) {
9946
10054
  node = node.parent;
@@ -9949,10 +10057,10 @@ function getThisContainer(node, includeArrowFunctions) {
9949
10057
  }
9950
10058
  switch (node.kind) {
9951
10059
  case 164 /* ComputedPropertyName */:
9952
- if (isClassLike(node.parent.parent)) {
10060
+ if (includeClassComputedPropertyName && isClassLike(node.parent.parent)) {
9953
10061
  return node;
9954
10062
  }
9955
- node = node.parent;
10063
+ node = node.parent.parent;
9956
10064
  break;
9957
10065
  case 167 /* Decorator */:
9958
10066
  if (node.parent.kind === 166 /* Parameter */ && isClassElement(node.parent.parent)) {
@@ -9989,7 +10097,7 @@ function isInTopLevelContext(node) {
9989
10097
  if (isIdentifier(node) && (isClassDeclaration(node.parent) || isFunctionDeclaration(node.parent)) && node.parent.name === node) {
9990
10098
  node = node.parent;
9991
10099
  }
9992
- const container = getThisContainer(node, true);
10100
+ const container = getThisContainer(node, true, false);
9993
10101
  return isSourceFile(container);
9994
10102
  }
9995
10103
  function getImmediatelyInvokedFunctionExpression(func) {
@@ -10262,6 +10370,78 @@ function getSingleVariableOfVariableStatement(node) {
10262
10370
  function getNestedModuleDeclaration(node) {
10263
10371
  return isModuleDeclaration(node) && node.body && node.body.kind === 264 /* ModuleDeclaration */ ? node.body : void 0;
10264
10372
  }
10373
+ function canHaveJSDoc(node) {
10374
+ switch (node.kind) {
10375
+ case 216 /* ArrowFunction */:
10376
+ case 223 /* BinaryExpression */:
10377
+ case 238 /* Block */:
10378
+ case 249 /* BreakStatement */:
10379
+ case 176 /* CallSignature */:
10380
+ case 292 /* CaseClause */:
10381
+ case 260 /* ClassDeclaration */:
10382
+ case 228 /* ClassExpression */:
10383
+ case 172 /* ClassStaticBlockDeclaration */:
10384
+ case 173 /* Constructor */:
10385
+ case 182 /* ConstructorType */:
10386
+ case 177 /* ConstructSignature */:
10387
+ case 248 /* ContinueStatement */:
10388
+ case 256 /* DebuggerStatement */:
10389
+ case 243 /* DoStatement */:
10390
+ case 209 /* ElementAccessExpression */:
10391
+ case 239 /* EmptyStatement */:
10392
+ case 1 /* EndOfFileToken */:
10393
+ case 263 /* EnumDeclaration */:
10394
+ case 302 /* EnumMember */:
10395
+ case 274 /* ExportAssignment */:
10396
+ case 275 /* ExportDeclaration */:
10397
+ case 278 /* ExportSpecifier */:
10398
+ case 241 /* ExpressionStatement */:
10399
+ case 246 /* ForInStatement */:
10400
+ case 247 /* ForOfStatement */:
10401
+ case 245 /* ForStatement */:
10402
+ case 259 /* FunctionDeclaration */:
10403
+ case 215 /* FunctionExpression */:
10404
+ case 181 /* FunctionType */:
10405
+ case 174 /* GetAccessor */:
10406
+ case 79 /* Identifier */:
10407
+ case 242 /* IfStatement */:
10408
+ case 269 /* ImportDeclaration */:
10409
+ case 268 /* ImportEqualsDeclaration */:
10410
+ case 178 /* IndexSignature */:
10411
+ case 261 /* InterfaceDeclaration */:
10412
+ case 320 /* JSDocFunctionType */:
10413
+ case 326 /* JSDocSignature */:
10414
+ case 253 /* LabeledStatement */:
10415
+ case 171 /* MethodDeclaration */:
10416
+ case 170 /* MethodSignature */:
10417
+ case 264 /* ModuleDeclaration */:
10418
+ case 199 /* NamedTupleMember */:
10419
+ case 267 /* NamespaceExportDeclaration */:
10420
+ case 207 /* ObjectLiteralExpression */:
10421
+ case 166 /* Parameter */:
10422
+ case 214 /* ParenthesizedExpression */:
10423
+ case 208 /* PropertyAccessExpression */:
10424
+ case 299 /* PropertyAssignment */:
10425
+ case 169 /* PropertyDeclaration */:
10426
+ case 168 /* PropertySignature */:
10427
+ case 250 /* ReturnStatement */:
10428
+ case 175 /* SetAccessor */:
10429
+ case 300 /* ShorthandPropertyAssignment */:
10430
+ case 301 /* SpreadAssignment */:
10431
+ case 252 /* SwitchStatement */:
10432
+ case 254 /* ThrowStatement */:
10433
+ case 255 /* TryStatement */:
10434
+ case 262 /* TypeAliasDeclaration */:
10435
+ case 165 /* TypeParameter */:
10436
+ case 257 /* VariableDeclaration */:
10437
+ case 240 /* VariableStatement */:
10438
+ case 244 /* WhileStatement */:
10439
+ case 251 /* WithStatement */:
10440
+ return true;
10441
+ default:
10442
+ return false;
10443
+ }
10444
+ }
10265
10445
  function getJSDocCommentsAndTags(hostNode, noCache) {
10266
10446
  let result;
10267
10447
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
@@ -10991,6 +11171,7 @@ function Node4(kind, pos, end) {
10991
11171
  this.transformFlags = 0 /* None */;
10992
11172
  this.parent = void 0;
10993
11173
  this.original = void 0;
11174
+ this.emitNode = void 0;
10994
11175
  }
10995
11176
  function Token(kind, pos, end) {
10996
11177
  this.pos = pos;
@@ -11000,6 +11181,7 @@ function Token(kind, pos, end) {
11000
11181
  this.flags = 0 /* None */;
11001
11182
  this.transformFlags = 0 /* None */;
11002
11183
  this.parent = void 0;
11184
+ this.emitNode = void 0;
11003
11185
  }
11004
11186
  function Identifier2(kind, pos, end) {
11005
11187
  this.pos = pos;
@@ -11010,6 +11192,7 @@ function Identifier2(kind, pos, end) {
11010
11192
  this.transformFlags = 0 /* None */;
11011
11193
  this.parent = void 0;
11012
11194
  this.original = void 0;
11195
+ this.emitNode = void 0;
11013
11196
  this.flowNode = void 0;
11014
11197
  }
11015
11198
  function SourceMapSource(fileName, text, skipTrivia2) {
@@ -12453,12 +12636,6 @@ function createNodeFactory(flags, baseFactory2) {
12453
12636
  get updateJSDocThisTag() {
12454
12637
  return getJSDocTypeLikeTagUpdateFunction(345 /* JSDocThisTag */);
12455
12638
  },
12456
- get createJSDocEnumTag() {
12457
- return getJSDocTypeLikeTagCreateFunction(342 /* JSDocEnumTag */);
12458
- },
12459
- get updateJSDocEnumTag() {
12460
- return getJSDocTypeLikeTagUpdateFunction(342 /* JSDocEnumTag */);
12461
- },
12462
12639
  get createJSDocAuthorTag() {
12463
12640
  return getJSDocSimpleTagCreateFunction(333 /* JSDocAuthorTag */);
12464
12641
  },
@@ -12507,6 +12684,8 @@ function createNodeFactory(flags, baseFactory2) {
12507
12684
  get updateJSDocDeprecatedTag() {
12508
12685
  return getJSDocSimpleTagUpdateFunction(334 /* JSDocDeprecatedTag */);
12509
12686
  },
12687
+ createJSDocEnumTag,
12688
+ updateJSDocEnumTag,
12510
12689
  createJSDocUnknownTag,
12511
12690
  updateJSDocUnknownTag,
12512
12691
  createJSDocText,
@@ -12553,6 +12732,7 @@ function createNodeFactory(flags, baseFactory2) {
12553
12732
  updateEnumMember,
12554
12733
  createSourceFile: createSourceFile2,
12555
12734
  updateSourceFile,
12735
+ createRedirectedSourceFile,
12556
12736
  createBundle,
12557
12737
  updateBundle,
12558
12738
  createUnparsedSource,
@@ -12729,8 +12909,10 @@ function createNodeFactory(flags, baseFactory2) {
12729
12909
  }
12730
12910
  const length2 = elements.length;
12731
12911
  const array = length2 >= 1 && length2 <= 4 ? elements.slice() : elements;
12732
- setTextRangePosEnd(array, -1, -1);
12912
+ array.pos = -1;
12913
+ array.end = -1;
12733
12914
  array.hasTrailingComma = !!hasTrailingComma;
12915
+ array.transformFlags = 0 /* None */;
12734
12916
  aggregateChildrenFlags(array);
12735
12917
  Debug.attachNodeArrayDebugInfo(array);
12736
12918
  return array;
@@ -12742,61 +12924,6 @@ function createNodeFactory(flags, baseFactory2) {
12742
12924
  const node = createBaseNode(kind);
12743
12925
  node.symbol = void 0;
12744
12926
  node.localSymbol = void 0;
12745
- node.locals = void 0;
12746
- node.nextContainer = void 0;
12747
- return node;
12748
- }
12749
- function createBaseNamedDeclaration(kind, modifiers, name) {
12750
- const node = createBaseDeclaration(kind);
12751
- name = asName(name);
12752
- node.name = name;
12753
- if (canHaveModifiers(node)) {
12754
- node.modifiers = asNodeArray(modifiers);
12755
- node.transformFlags |= propagateChildrenFlags(node.modifiers);
12756
- }
12757
- if (name) {
12758
- switch (node.kind) {
12759
- case 171 /* MethodDeclaration */:
12760
- case 174 /* GetAccessor */:
12761
- case 175 /* SetAccessor */:
12762
- case 169 /* PropertyDeclaration */:
12763
- case 299 /* PropertyAssignment */:
12764
- if (isIdentifier(name)) {
12765
- node.transformFlags |= propagateIdentifierNameFlags(name);
12766
- break;
12767
- }
12768
- default:
12769
- node.transformFlags |= propagateChildFlags(name);
12770
- break;
12771
- }
12772
- }
12773
- return node;
12774
- }
12775
- function createBaseGenericNamedDeclaration(kind, modifiers, name, typeParameters) {
12776
- const node = createBaseNamedDeclaration(
12777
- kind,
12778
- modifiers,
12779
- name
12780
- );
12781
- node.typeParameters = asNodeArray(typeParameters);
12782
- node.transformFlags |= propagateChildrenFlags(node.typeParameters);
12783
- if (typeParameters)
12784
- node.transformFlags |= 1 /* ContainsTypeScript */;
12785
- return node;
12786
- }
12787
- function createBaseSignatureDeclaration(kind, modifiers, name, typeParameters, parameters, type) {
12788
- const node = createBaseGenericNamedDeclaration(
12789
- kind,
12790
- modifiers,
12791
- name,
12792
- typeParameters
12793
- );
12794
- node.parameters = createNodeArray(parameters);
12795
- node.type = type;
12796
- node.transformFlags |= propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type);
12797
- if (type)
12798
- node.transformFlags |= 1 /* ContainsTypeScript */;
12799
- node.typeArguments = void 0;
12800
12927
  return node;
12801
12928
  }
12802
12929
  function finishUpdateBaseSignatureDeclaration(updated, original) {
@@ -12805,86 +12932,23 @@ function createNodeFactory(flags, baseFactory2) {
12805
12932
  }
12806
12933
  return update(updated, original);
12807
12934
  }
12808
- function createBaseFunctionLikeDeclaration(kind, modifiers, name, typeParameters, parameters, type, body) {
12809
- const node = createBaseSignatureDeclaration(
12810
- kind,
12811
- modifiers,
12812
- name,
12813
- typeParameters,
12814
- parameters,
12815
- type
12816
- );
12817
- node.body = body;
12818
- node.transformFlags |= propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */;
12819
- if (!body)
12820
- node.transformFlags |= 1 /* ContainsTypeScript */;
12821
- return node;
12822
- }
12823
- function createBaseInterfaceOrClassLikeDeclaration(kind, modifiers, name, typeParameters, heritageClauses) {
12824
- const node = createBaseGenericNamedDeclaration(
12825
- kind,
12826
- modifiers,
12827
- name,
12828
- typeParameters
12829
- );
12830
- node.heritageClauses = asNodeArray(heritageClauses);
12831
- node.transformFlags |= propagateChildrenFlags(node.heritageClauses);
12832
- return node;
12833
- }
12834
- function createBaseClassLikeDeclaration(kind, modifiers, name, typeParameters, heritageClauses, members) {
12835
- const node = createBaseInterfaceOrClassLikeDeclaration(
12836
- kind,
12837
- modifiers,
12838
- name,
12839
- typeParameters,
12840
- heritageClauses
12841
- );
12842
- node.members = createNodeArray(members);
12843
- node.transformFlags |= propagateChildrenFlags(node.members);
12844
- return node;
12845
- }
12846
- function createBaseBindingLikeDeclaration(kind, modifiers, name, initializer) {
12847
- const node = createBaseNamedDeclaration(
12848
- kind,
12849
- modifiers,
12850
- name
12851
- );
12852
- node.initializer = initializer;
12853
- node.transformFlags |= propagateChildFlags(node.initializer);
12854
- return node;
12855
- }
12856
- function createBaseVariableLikeDeclaration(kind, modifiers, name, type, initializer) {
12857
- const node = createBaseBindingLikeDeclaration(
12858
- kind,
12859
- modifiers,
12860
- name,
12861
- initializer
12862
- );
12863
- node.type = type;
12864
- node.transformFlags |= propagateChildFlags(type);
12865
- if (type)
12866
- node.transformFlags |= 1 /* ContainsTypeScript */;
12867
- return node;
12868
- }
12869
- function createBaseLiteral(kind, text) {
12870
- const node = createBaseToken(kind);
12871
- node.text = text;
12872
- return node;
12873
- }
12874
12935
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
12875
- const node = createBaseLiteral(8 /* NumericLiteral */, typeof value === "number" ? value + "" : value);
12936
+ const node = createBaseDeclaration(8 /* NumericLiteral */);
12937
+ node.text = typeof value === "number" ? value + "" : value;
12876
12938
  node.numericLiteralFlags = numericLiteralFlags;
12877
12939
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
12878
12940
  node.transformFlags |= 1024 /* ContainsES2015 */;
12879
12941
  return node;
12880
12942
  }
12881
12943
  function createBigIntLiteral(value) {
12882
- const node = createBaseLiteral(9 /* BigIntLiteral */, typeof value === "string" ? value : pseudoBigIntToString(value) + "n");
12944
+ const node = createBaseToken(9 /* BigIntLiteral */);
12945
+ node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n";
12883
12946
  node.transformFlags |= 4 /* ContainsESNext */;
12884
12947
  return node;
12885
12948
  }
12886
12949
  function createBaseStringLiteral(text, isSingleQuote) {
12887
- const node = createBaseLiteral(10 /* StringLiteral */, text);
12950
+ const node = createBaseDeclaration(10 /* StringLiteral */);
12951
+ node.text = text;
12888
12952
  node.singleQuote = isSingleQuote;
12889
12953
  return node;
12890
12954
  }
@@ -12901,7 +12965,8 @@ function createNodeFactory(flags, baseFactory2) {
12901
12965
  return node;
12902
12966
  }
12903
12967
  function createRegularExpressionLiteral(text) {
12904
- const node = createBaseLiteral(13 /* RegularExpressionLiteral */, text);
12968
+ const node = createBaseToken(13 /* RegularExpressionLiteral */);
12969
+ node.text = text;
12905
12970
  return node;
12906
12971
  }
12907
12972
  function createLiteralLikeNode(kind, text) {
@@ -12922,20 +12987,15 @@ function createNodeFactory(flags, baseFactory2) {
12922
12987
  return createTemplateLiteralLikeNode(kind, text, void 0, 0);
12923
12988
  }
12924
12989
  }
12925
- function createBaseIdentifier(text, originalKeywordKind) {
12926
- if (originalKeywordKind === void 0 && text) {
12927
- originalKeywordKind = stringToToken(text);
12928
- }
12929
- if (originalKeywordKind === 79 /* Identifier */) {
12930
- originalKeywordKind = void 0;
12931
- }
12990
+ function createBaseIdentifier(escapedText, originalKeywordKind) {
12932
12991
  const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
12933
12992
  node.originalKeywordKind = originalKeywordKind;
12934
- node.escapedText = escapeLeadingUnderscores(text);
12993
+ node.escapedText = escapedText;
12994
+ node.autoGenerateFlags = 0 /* None */;
12935
12995
  return node;
12936
12996
  }
12937
12997
  function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
12938
- const node = createBaseIdentifier(text, void 0);
12998
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text), void 0);
12939
12999
  node.autoGenerateFlags = autoGenerateFlags;
12940
13000
  node.autoGenerateId = nextAutoGenerateId;
12941
13001
  node.autoGeneratePrefix = prefix;
@@ -12944,15 +13004,23 @@ function createNodeFactory(flags, baseFactory2) {
12944
13004
  return node;
12945
13005
  }
12946
13006
  function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
12947
- const node = createBaseIdentifier(text, originalKeywordKind);
12948
- if (typeArguments) {
12949
- node.typeArguments = createNodeArray(typeArguments);
13007
+ if (originalKeywordKind === void 0 && text) {
13008
+ originalKeywordKind = stringToToken(text);
13009
+ }
13010
+ if (originalKeywordKind === 79 /* Identifier */) {
13011
+ originalKeywordKind = void 0;
12950
13012
  }
13013
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind);
13014
+ node.typeArguments = asNodeArray(typeArguments);
13015
+ node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
13016
+ node.jsDoc = void 0;
13017
+ node.jsDocCache = void 0;
13018
+ node.flowNode = void 0;
13019
+ node.symbol = void 0;
12951
13020
  if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
12952
13021
  node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
12953
13022
  }
12954
- if (hasExtendedUnicodeEscape) {
12955
- node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
13023
+ if (node.hasExtendedUnicodeEscape) {
12956
13024
  node.transformFlags |= 1024 /* ContainsES2015 */;
12957
13025
  }
12958
13026
  return node;
@@ -12990,19 +13058,20 @@ function createNodeFactory(flags, baseFactory2) {
12990
13058
  name.original = node;
12991
13059
  return name;
12992
13060
  }
12993
- function createBasePrivateIdentifier(text) {
13061
+ function createBasePrivateIdentifier(escapedText) {
12994
13062
  const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
12995
- node.escapedText = escapeLeadingUnderscores(text);
13063
+ node.escapedText = escapedText;
13064
+ node.autoGenerateFlags = 0 /* None */;
12996
13065
  node.transformFlags |= 16777216 /* ContainsClassFields */;
12997
13066
  return node;
12998
13067
  }
12999
13068
  function createPrivateIdentifier(text) {
13000
13069
  if (!startsWith(text, "#"))
13001
13070
  Debug.fail("First character of private identifier must be #: " + text);
13002
- return createBasePrivateIdentifier(text);
13071
+ return createBasePrivateIdentifier(escapeLeadingUnderscores(text));
13003
13072
  }
13004
13073
  function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
13005
- const node = createBasePrivateIdentifier(text);
13074
+ const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
13006
13075
  node.autoGenerateFlags = autoGenerateFlags;
13007
13076
  node.autoGenerateId = nextAutoGenerateId;
13008
13077
  node.autoGeneratePrefix = prefix;
@@ -13062,6 +13131,7 @@ function createNodeFactory(flags, baseFactory2) {
13062
13131
  break;
13063
13132
  case 106 /* SuperKeyword */:
13064
13133
  transformFlags = 1024 /* ContainsES2015 */ | 134217728 /* ContainsLexicalSuper */;
13134
+ node.flowNode = void 0;
13065
13135
  break;
13066
13136
  case 124 /* StaticKeyword */:
13067
13137
  transformFlags = 1024 /* ContainsES2015 */;
@@ -13071,6 +13141,7 @@ function createNodeFactory(flags, baseFactory2) {
13071
13141
  break;
13072
13142
  case 108 /* ThisKeyword */:
13073
13143
  transformFlags = 16384 /* ContainsLexicalThis */;
13144
+ node.flowNode = void 0;
13074
13145
  break;
13075
13146
  }
13076
13147
  if (transformFlags) {
@@ -13135,6 +13206,7 @@ function createNodeFactory(flags, baseFactory2) {
13135
13206
  node.left = left;
13136
13207
  node.right = asName(right);
13137
13208
  node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right);
13209
+ node.flowNode = void 0;
13138
13210
  return node;
13139
13211
  }
13140
13212
  function updateQualifiedName(node, left, right) {
@@ -13150,40 +13222,36 @@ function createNodeFactory(flags, baseFactory2) {
13150
13222
  return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node;
13151
13223
  }
13152
13224
  function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) {
13153
- const node = createBaseNamedDeclaration(
13154
- 165 /* TypeParameter */,
13155
- modifiers,
13156
- name
13157
- );
13225
+ const node = createBaseDeclaration(165 /* TypeParameter */);
13226
+ node.modifiers = asNodeArray(modifiers);
13227
+ node.name = asName(name);
13158
13228
  node.constraint = constraint;
13159
13229
  node.default = defaultType;
13160
13230
  node.transformFlags = 1 /* ContainsTypeScript */;
13231
+ node.expression = void 0;
13232
+ node.jsDoc = void 0;
13233
+ node.jsDocCache = void 0;
13161
13234
  return node;
13162
13235
  }
13163
13236
  function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) {
13164
13237
  return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node;
13165
13238
  }
13166
13239
  function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) {
13167
- const node = createBaseVariableLikeDeclaration(
13168
- 166 /* Parameter */,
13169
- modifiers,
13170
- name,
13171
- type,
13172
- initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
13173
- );
13240
+ var _a2, _b;
13241
+ const node = createBaseDeclaration(166 /* Parameter */);
13242
+ node.modifiers = asNodeArray(modifiers);
13174
13243
  node.dotDotDotToken = dotDotDotToken;
13244
+ node.name = asName(name);
13175
13245
  node.questionToken = questionToken;
13246
+ node.type = type;
13247
+ node.initializer = asInitializer(initializer);
13176
13248
  if (isThisIdentifier(node.name)) {
13177
13249
  node.transformFlags = 1 /* ContainsTypeScript */;
13178
13250
  } else {
13179
- node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.questionToken);
13180
- if (questionToken)
13181
- node.transformFlags |= 1 /* ContainsTypeScript */;
13182
- if (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */)
13183
- node.transformFlags |= 8192 /* ContainsTypeScriptClassSyntax */;
13184
- if (initializer || dotDotDotToken)
13185
- node.transformFlags |= 1024 /* ContainsES2015 */;
13251
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (((_a2 = node.questionToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */) | (((_b = node.dotDotDotToken) != null ? _b : node.initializer) ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */);
13186
13252
  }
13253
+ node.jsDoc = void 0;
13254
+ node.jsDocCache = void 0;
13187
13255
  return node;
13188
13256
  }
13189
13257
  function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
@@ -13199,15 +13267,15 @@ function createNodeFactory(flags, baseFactory2) {
13199
13267
  return node.expression !== expression ? update(createDecorator(expression), node) : node;
13200
13268
  }
13201
13269
  function createPropertySignature(modifiers, name, questionToken, type) {
13202
- const node = createBaseNamedDeclaration(
13203
- 168 /* PropertySignature */,
13204
- modifiers,
13205
- name
13206
- );
13270
+ const node = createBaseDeclaration(168 /* PropertySignature */);
13271
+ node.modifiers = asNodeArray(modifiers);
13272
+ node.name = asName(name);
13207
13273
  node.type = type;
13208
13274
  node.questionToken = questionToken;
13209
13275
  node.transformFlags = 1 /* ContainsTypeScript */;
13210
13276
  node.initializer = void 0;
13277
+ node.jsDoc = void 0;
13278
+ node.jsDocCache = void 0;
13211
13279
  return node;
13212
13280
  }
13213
13281
  function updatePropertySignature(node, modifiers, name, questionToken, type) {
@@ -13220,69 +13288,68 @@ function createNodeFactory(flags, baseFactory2) {
13220
13288
  return update(updated, original);
13221
13289
  }
13222
13290
  function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) {
13223
- const node = createBaseVariableLikeDeclaration(
13224
- 169 /* PropertyDeclaration */,
13225
- modifiers,
13226
- name,
13227
- type,
13228
- initializer
13229
- );
13291
+ const node = createBaseDeclaration(169 /* PropertyDeclaration */);
13292
+ node.modifiers = asNodeArray(modifiers);
13293
+ node.name = asName(name);
13230
13294
  node.questionToken = questionOrExclamationToken && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
13231
13295
  node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
13232
- node.transformFlags |= propagateChildFlags(node.questionToken) | propagateChildFlags(node.exclamationToken) | 16777216 /* ContainsClassFields */;
13233
- if (isComputedPropertyName(node.name) || hasStaticModifier(node) && node.initializer) {
13234
- node.transformFlags |= 8192 /* ContainsTypeScriptClassSyntax */;
13235
- }
13236
- if (questionOrExclamationToken || modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
13237
- node.transformFlags |= 1 /* ContainsTypeScript */;
13238
- }
13296
+ node.type = type;
13297
+ node.initializer = asInitializer(initializer);
13298
+ const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */;
13299
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */;
13300
+ node.jsDoc = void 0;
13301
+ node.jsDocCache = void 0;
13239
13302
  return node;
13240
13303
  }
13241
13304
  function updatePropertyDeclaration(node, modifiers, name, questionOrExclamationToken, type, initializer) {
13242
13305
  return node.modifiers !== modifiers || node.name !== name || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type || node.initializer !== initializer ? update(createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer), node) : node;
13243
13306
  }
13244
13307
  function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) {
13245
- const node = createBaseSignatureDeclaration(
13246
- 170 /* MethodSignature */,
13247
- modifiers,
13248
- name,
13249
- typeParameters,
13250
- parameters,
13251
- type
13252
- );
13308
+ const node = createBaseDeclaration(170 /* MethodSignature */);
13309
+ node.modifiers = asNodeArray(modifiers);
13310
+ node.name = asName(name);
13253
13311
  node.questionToken = questionToken;
13312
+ node.typeParameters = asNodeArray(typeParameters);
13313
+ node.parameters = asNodeArray(parameters);
13314
+ node.type = type;
13254
13315
  node.transformFlags = 1 /* ContainsTypeScript */;
13316
+ node.jsDoc = void 0;
13317
+ node.jsDocCache = void 0;
13318
+ node.locals = void 0;
13319
+ node.nextContainer = void 0;
13320
+ node.typeArguments = void 0;
13255
13321
  return node;
13256
13322
  }
13257
13323
  function updateMethodSignature(node, modifiers, name, questionToken, typeParameters, parameters, type) {
13258
13324
  return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node) : node;
13259
13325
  }
13260
13326
  function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
13261
- const node = createBaseFunctionLikeDeclaration(
13262
- 171 /* MethodDeclaration */,
13263
- modifiers,
13264
- name,
13265
- typeParameters,
13266
- parameters,
13267
- type,
13268
- body
13269
- );
13327
+ const node = createBaseDeclaration(171 /* MethodDeclaration */);
13328
+ node.modifiers = asNodeArray(modifiers);
13270
13329
  node.asteriskToken = asteriskToken;
13330
+ node.name = asName(name);
13271
13331
  node.questionToken = questionToken;
13272
- node.transformFlags |= propagateChildFlags(node.asteriskToken) | propagateChildFlags(node.questionToken) | 1024 /* ContainsES2015 */;
13273
- if (questionToken) {
13274
- node.transformFlags |= 1 /* ContainsTypeScript */;
13275
- }
13276
- if (modifiersToFlags(node.modifiers) & 512 /* Async */) {
13277
- if (asteriskToken) {
13278
- node.transformFlags |= 128 /* ContainsES2018 */;
13279
- } else {
13280
- node.transformFlags |= 256 /* ContainsES2017 */;
13281
- }
13282
- } else if (asteriskToken) {
13283
- node.transformFlags |= 2048 /* ContainsGenerator */;
13284
- }
13285
13332
  node.exclamationToken = void 0;
13333
+ node.typeParameters = asNodeArray(typeParameters);
13334
+ node.parameters = createNodeArray(parameters);
13335
+ node.type = type;
13336
+ node.body = body;
13337
+ if (!node.body) {
13338
+ node.transformFlags = 1 /* ContainsTypeScript */;
13339
+ } else {
13340
+ const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */;
13341
+ const isGenerator = !!node.asteriskToken;
13342
+ const isAsyncGenerator = isAsync && isGenerator;
13343
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.questionToken || node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
13344
+ }
13345
+ node.typeArguments = void 0;
13346
+ node.jsDoc = void 0;
13347
+ node.jsDocCache = void 0;
13348
+ node.locals = void 0;
13349
+ node.nextContainer = void 0;
13350
+ node.flowNode = void 0;
13351
+ node.endFlowNode = void 0;
13352
+ node.returnFlowNode = void 0;
13286
13353
  return node;
13287
13354
  }
13288
13355
  function updateMethodDeclaration(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
@@ -13295,16 +13362,17 @@ function createNodeFactory(flags, baseFactory2) {
13295
13362
  return update(updated, original);
13296
13363
  }
13297
13364
  function createClassStaticBlockDeclaration(body) {
13298
- const node = createBaseGenericNamedDeclaration(
13299
- 172 /* ClassStaticBlockDeclaration */,
13300
- void 0,
13301
- void 0,
13302
- void 0
13303
- );
13365
+ const node = createBaseDeclaration(172 /* ClassStaticBlockDeclaration */);
13304
13366
  node.body = body;
13305
13367
  node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */;
13306
13368
  node.illegalDecorators = void 0;
13307
13369
  node.modifiers = void 0;
13370
+ node.jsDoc = void 0;
13371
+ node.jsDocCache = void 0;
13372
+ node.locals = void 0;
13373
+ node.nextContainer = void 0;
13374
+ node.endFlowNode = void 0;
13375
+ node.returnFlowNode = void 0;
13308
13376
  return node;
13309
13377
  }
13310
13378
  function updateClassStaticBlockDeclaration(node, body) {
@@ -13318,19 +13386,21 @@ function createNodeFactory(flags, baseFactory2) {
13318
13386
  return update(updated, original);
13319
13387
  }
13320
13388
  function createConstructorDeclaration(modifiers, parameters, body) {
13321
- const node = createBaseFunctionLikeDeclaration(
13322
- 173 /* Constructor */,
13323
- modifiers,
13324
- void 0,
13325
- void 0,
13326
- parameters,
13327
- void 0,
13328
- body
13329
- );
13330
- node.transformFlags |= 1024 /* ContainsES2015 */;
13389
+ const node = createBaseDeclaration(173 /* Constructor */);
13390
+ node.modifiers = asNodeArray(modifiers);
13391
+ node.parameters = createNodeArray(parameters);
13392
+ node.body = body;
13393
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | 1024 /* ContainsES2015 */;
13331
13394
  node.illegalDecorators = void 0;
13332
13395
  node.typeParameters = void 0;
13333
13396
  node.type = void 0;
13397
+ node.typeArguments = void 0;
13398
+ node.jsDoc = void 0;
13399
+ node.jsDocCache = void 0;
13400
+ node.locals = void 0;
13401
+ node.nextContainer = void 0;
13402
+ node.endFlowNode = void 0;
13403
+ node.returnFlowNode = void 0;
13334
13404
  return node;
13335
13405
  }
13336
13406
  function updateConstructorDeclaration(node, modifiers, parameters, body) {
@@ -13345,16 +13415,26 @@ function createNodeFactory(flags, baseFactory2) {
13345
13415
  return finishUpdateBaseSignatureDeclaration(updated, original);
13346
13416
  }
13347
13417
  function createGetAccessorDeclaration(modifiers, name, parameters, type, body) {
13348
- const node = createBaseFunctionLikeDeclaration(
13349
- 174 /* GetAccessor */,
13350
- modifiers,
13351
- name,
13352
- void 0,
13353
- parameters,
13354
- type,
13355
- body
13356
- );
13418
+ const node = createBaseDeclaration(174 /* GetAccessor */);
13419
+ node.modifiers = asNodeArray(modifiers);
13420
+ node.name = asName(name);
13421
+ node.parameters = createNodeArray(parameters);
13422
+ node.type = type;
13423
+ node.body = body;
13424
+ if (!node.body) {
13425
+ node.transformFlags = 1 /* ContainsTypeScript */;
13426
+ } else {
13427
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
13428
+ }
13429
+ node.typeArguments = void 0;
13357
13430
  node.typeParameters = void 0;
13431
+ node.jsDoc = void 0;
13432
+ node.jsDocCache = void 0;
13433
+ node.locals = void 0;
13434
+ node.nextContainer = void 0;
13435
+ node.flowNode = void 0;
13436
+ node.endFlowNode = void 0;
13437
+ node.returnFlowNode = void 0;
13358
13438
  return node;
13359
13439
  }
13360
13440
  function updateGetAccessorDeclaration(node, modifiers, name, parameters, type, body) {
@@ -13367,17 +13447,26 @@ function createNodeFactory(flags, baseFactory2) {
13367
13447
  return finishUpdateBaseSignatureDeclaration(updated, original);
13368
13448
  }
13369
13449
  function createSetAccessorDeclaration(modifiers, name, parameters, body) {
13370
- const node = createBaseFunctionLikeDeclaration(
13371
- 175 /* SetAccessor */,
13372
- modifiers,
13373
- name,
13374
- void 0,
13375
- parameters,
13376
- void 0,
13377
- body
13378
- );
13450
+ const node = createBaseDeclaration(175 /* SetAccessor */);
13451
+ node.modifiers = asNodeArray(modifiers);
13452
+ node.name = asName(name);
13453
+ node.parameters = createNodeArray(parameters);
13454
+ node.body = body;
13455
+ if (!node.body) {
13456
+ node.transformFlags = 1 /* ContainsTypeScript */;
13457
+ } else {
13458
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
13459
+ }
13460
+ node.typeArguments = void 0;
13379
13461
  node.typeParameters = void 0;
13380
13462
  node.type = void 0;
13463
+ node.jsDoc = void 0;
13464
+ node.jsDocCache = void 0;
13465
+ node.locals = void 0;
13466
+ node.nextContainer = void 0;
13467
+ node.flowNode = void 0;
13468
+ node.endFlowNode = void 0;
13469
+ node.returnFlowNode = void 0;
13381
13470
  return node;
13382
13471
  }
13383
13472
  function updateSetAccessorDeclaration(node, modifiers, name, parameters, body) {
@@ -13391,45 +13480,49 @@ function createNodeFactory(flags, baseFactory2) {
13391
13480
  return finishUpdateBaseSignatureDeclaration(updated, original);
13392
13481
  }
13393
13482
  function createCallSignature(typeParameters, parameters, type) {
13394
- const node = createBaseSignatureDeclaration(
13395
- 176 /* CallSignature */,
13396
- void 0,
13397
- void 0,
13398
- typeParameters,
13399
- parameters,
13400
- type
13401
- );
13483
+ const node = createBaseDeclaration(176 /* CallSignature */);
13484
+ node.typeParameters = asNodeArray(typeParameters);
13485
+ node.parameters = asNodeArray(parameters);
13486
+ node.type = type;
13402
13487
  node.transformFlags = 1 /* ContainsTypeScript */;
13488
+ node.jsDoc = void 0;
13489
+ node.jsDocCache = void 0;
13490
+ node.locals = void 0;
13491
+ node.nextContainer = void 0;
13492
+ node.typeArguments = void 0;
13403
13493
  return node;
13404
13494
  }
13405
13495
  function updateCallSignature(node, typeParameters, parameters, type) {
13406
13496
  return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node;
13407
13497
  }
13408
13498
  function createConstructSignature(typeParameters, parameters, type) {
13409
- const node = createBaseSignatureDeclaration(
13410
- 177 /* ConstructSignature */,
13411
- void 0,
13412
- void 0,
13413
- typeParameters,
13414
- parameters,
13415
- type
13416
- );
13499
+ const node = createBaseDeclaration(177 /* ConstructSignature */);
13500
+ node.typeParameters = asNodeArray(typeParameters);
13501
+ node.parameters = asNodeArray(parameters);
13502
+ node.type = type;
13417
13503
  node.transformFlags = 1 /* ContainsTypeScript */;
13504
+ node.jsDoc = void 0;
13505
+ node.jsDocCache = void 0;
13506
+ node.locals = void 0;
13507
+ node.nextContainer = void 0;
13508
+ node.typeArguments = void 0;
13418
13509
  return node;
13419
13510
  }
13420
13511
  function updateConstructSignature(node, typeParameters, parameters, type) {
13421
13512
  return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node;
13422
13513
  }
13423
13514
  function createIndexSignature(modifiers, parameters, type) {
13424
- const node = createBaseSignatureDeclaration(
13425
- 178 /* IndexSignature */,
13426
- modifiers,
13427
- void 0,
13428
- void 0,
13429
- parameters,
13430
- type
13431
- );
13515
+ const node = createBaseDeclaration(178 /* IndexSignature */);
13516
+ node.modifiers = asNodeArray(modifiers);
13517
+ node.parameters = asNodeArray(parameters);
13518
+ node.type = type;
13432
13519
  node.transformFlags = 1 /* ContainsTypeScript */;
13520
+ node.illegalDecorators = void 0;
13521
+ node.jsDoc = void 0;
13522
+ node.jsDocCache = void 0;
13523
+ node.locals = void 0;
13524
+ node.nextContainer = void 0;
13525
+ node.typeArguments = void 0;
13433
13526
  return node;
13434
13527
  }
13435
13528
  function updateIndexSignature(node, modifiers, parameters, type) {
@@ -13470,16 +13563,17 @@ function createNodeFactory(flags, baseFactory2) {
13470
13563
  return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node;
13471
13564
  }
13472
13565
  function createFunctionTypeNode(typeParameters, parameters, type) {
13473
- const node = createBaseSignatureDeclaration(
13474
- 181 /* FunctionType */,
13475
- void 0,
13476
- void 0,
13477
- typeParameters,
13478
- parameters,
13479
- type
13480
- );
13566
+ const node = createBaseDeclaration(181 /* FunctionType */);
13567
+ node.typeParameters = asNodeArray(typeParameters);
13568
+ node.parameters = asNodeArray(parameters);
13569
+ node.type = type;
13481
13570
  node.transformFlags = 1 /* ContainsTypeScript */;
13482
13571
  node.modifiers = void 0;
13572
+ node.jsDoc = void 0;
13573
+ node.jsDocCache = void 0;
13574
+ node.locals = void 0;
13575
+ node.nextContainer = void 0;
13576
+ node.typeArguments = void 0;
13483
13577
  return node;
13484
13578
  }
13485
13579
  function updateFunctionTypeNode(node, typeParameters, parameters, type) {
@@ -13495,15 +13589,17 @@ function createNodeFactory(flags, baseFactory2) {
13495
13589
  return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified.");
13496
13590
  }
13497
13591
  function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {
13498
- const node = createBaseSignatureDeclaration(
13499
- 182 /* ConstructorType */,
13500
- modifiers,
13501
- void 0,
13502
- typeParameters,
13503
- parameters,
13504
- type
13505
- );
13592
+ const node = createBaseDeclaration(182 /* ConstructorType */);
13593
+ node.modifiers = asNodeArray(modifiers);
13594
+ node.typeParameters = asNodeArray(typeParameters);
13595
+ node.parameters = asNodeArray(parameters);
13596
+ node.type = type;
13506
13597
  node.transformFlags = 1 /* ContainsTypeScript */;
13598
+ node.jsDoc = void 0;
13599
+ node.jsDocCache = void 0;
13600
+ node.locals = void 0;
13601
+ node.nextContainer = void 0;
13602
+ node.typeArguments = void 0;
13507
13603
  return node;
13508
13604
  }
13509
13605
  function createConstructorTypeNode2(typeParameters, parameters, type) {
@@ -13529,7 +13625,7 @@ function createNodeFactory(flags, baseFactory2) {
13529
13625
  return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node;
13530
13626
  }
13531
13627
  function createTypeLiteralNode(members) {
13532
- const node = createBaseNode(184 /* TypeLiteral */);
13628
+ const node = createBaseDeclaration(184 /* TypeLiteral */);
13533
13629
  node.members = createNodeArray(members);
13534
13630
  node.transformFlags = 1 /* ContainsTypeScript */;
13535
13631
  return node;
@@ -13556,12 +13652,14 @@ function createNodeFactory(flags, baseFactory2) {
13556
13652
  return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node;
13557
13653
  }
13558
13654
  function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
13559
- const node = createBaseNode(199 /* NamedTupleMember */);
13655
+ const node = createBaseDeclaration(199 /* NamedTupleMember */);
13560
13656
  node.dotDotDotToken = dotDotDotToken;
13561
13657
  node.name = name;
13562
13658
  node.questionToken = questionToken;
13563
13659
  node.type = type;
13564
13660
  node.transformFlags = 1 /* ContainsTypeScript */;
13661
+ node.jsDoc = void 0;
13662
+ node.jsDocCache = void 0;
13565
13663
  return node;
13566
13664
  }
13567
13665
  function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) {
@@ -13613,6 +13711,8 @@ function createNodeFactory(flags, baseFactory2) {
13613
13711
  node.trueType = trueType;
13614
13712
  node.falseType = falseType;
13615
13713
  node.transformFlags = 1 /* ContainsTypeScript */;
13714
+ node.locals = void 0;
13715
+ node.nextContainer = void 0;
13616
13716
  return node;
13617
13717
  }
13618
13718
  function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) {
@@ -13685,7 +13785,7 @@ function createNodeFactory(flags, baseFactory2) {
13685
13785
  return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node;
13686
13786
  }
13687
13787
  function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) {
13688
- const node = createBaseNode(197 /* MappedType */);
13788
+ const node = createBaseDeclaration(197 /* MappedType */);
13689
13789
  node.readonlyToken = readonlyToken;
13690
13790
  node.typeParameter = typeParameter;
13691
13791
  node.nameType = nameType;
@@ -13693,6 +13793,8 @@ function createNodeFactory(flags, baseFactory2) {
13693
13793
  node.type = type;
13694
13794
  node.members = members && createNodeArray(members);
13695
13795
  node.transformFlags = 1 /* ContainsTypeScript */;
13796
+ node.locals = void 0;
13797
+ node.nextContainer = void 0;
13696
13798
  return node;
13697
13799
  }
13698
13800
  function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) {
@@ -13729,31 +13831,20 @@ function createNodeFactory(flags, baseFactory2) {
13729
13831
  return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node;
13730
13832
  }
13731
13833
  function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
13732
- const node = createBaseBindingLikeDeclaration(
13733
- 205 /* BindingElement */,
13734
- void 0,
13735
- name,
13736
- initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
13737
- );
13738
- node.propertyName = asName(propertyName);
13834
+ const node = createBaseDeclaration(205 /* BindingElement */);
13739
13835
  node.dotDotDotToken = dotDotDotToken;
13740
- node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | 1024 /* ContainsES2015 */;
13741
- if (node.propertyName) {
13742
- node.transformFlags |= isIdentifier(node.propertyName) ? propagateIdentifierNameFlags(node.propertyName) : propagateChildFlags(node.propertyName);
13743
- }
13744
- if (dotDotDotToken)
13745
- node.transformFlags |= 32768 /* ContainsRestOrSpread */;
13836
+ node.propertyName = asName(propertyName);
13837
+ node.name = asName(name);
13838
+ node.initializer = asInitializer(initializer);
13839
+ node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.propertyName) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (node.dotDotDotToken ? 32768 /* ContainsRestOrSpread */ : 0 /* None */) | 1024 /* ContainsES2015 */;
13840
+ node.flowNode = void 0;
13746
13841
  return node;
13747
13842
  }
13748
13843
  function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) {
13749
13844
  return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node;
13750
13845
  }
13751
- function createBaseExpression(kind) {
13752
- const node = createBaseNode(kind);
13753
- return node;
13754
- }
13755
13846
  function createArrayLiteralExpression(elements, multiLine) {
13756
- const node = createBaseExpression(206 /* ArrayLiteralExpression */);
13847
+ const node = createBaseNode(206 /* ArrayLiteralExpression */);
13757
13848
  const lastElement = elements && lastOrUndefined(elements);
13758
13849
  const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0);
13759
13850
  node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
@@ -13765,20 +13856,34 @@ function createNodeFactory(flags, baseFactory2) {
13765
13856
  return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node;
13766
13857
  }
13767
13858
  function createObjectLiteralExpression(properties, multiLine) {
13768
- const node = createBaseExpression(207 /* ObjectLiteralExpression */);
13859
+ const node = createBaseDeclaration(207 /* ObjectLiteralExpression */);
13769
13860
  node.properties = createNodeArray(properties);
13770
13861
  node.multiLine = multiLine;
13771
13862
  node.transformFlags |= propagateChildrenFlags(node.properties);
13863
+ node.jsDoc = void 0;
13864
+ node.jsDocCache = void 0;
13772
13865
  return node;
13773
13866
  }
13774
13867
  function updateObjectLiteralExpression(node, properties) {
13775
13868
  return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node;
13776
13869
  }
13870
+ function createBasePropertyAccessExpression(expression, questionDotToken, name) {
13871
+ const node = createBaseDeclaration(208 /* PropertyAccessExpression */);
13872
+ node.expression = expression;
13873
+ node.questionDotToken = questionDotToken;
13874
+ node.name = name;
13875
+ node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
13876
+ node.jsDoc = void 0;
13877
+ node.jsDocCache = void 0;
13878
+ node.flowNode = void 0;
13879
+ return node;
13880
+ }
13777
13881
  function createPropertyAccessExpression(expression, name) {
13778
- const node = createBaseExpression(208 /* PropertyAccessExpression */);
13779
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
13780
- node.name = asName(name);
13781
- node.transformFlags = propagateChildFlags(node.expression) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
13882
+ const node = createBasePropertyAccessExpression(
13883
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false),
13884
+ void 0,
13885
+ asName(name)
13886
+ );
13782
13887
  if (isSuperKeyword(expression)) {
13783
13888
  node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */;
13784
13889
  }
@@ -13791,23 +13896,36 @@ function createNodeFactory(flags, baseFactory2) {
13791
13896
  return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node;
13792
13897
  }
13793
13898
  function createPropertyAccessChain(expression, questionDotToken, name) {
13794
- const node = createBaseExpression(208 /* PropertyAccessExpression */);
13899
+ const node = createBasePropertyAccessExpression(
13900
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true),
13901
+ questionDotToken,
13902
+ asName(name)
13903
+ );
13795
13904
  node.flags |= 32 /* OptionalChain */;
13796
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
13797
- node.questionDotToken = questionDotToken;
13798
- node.name = asName(name);
13799
- node.transformFlags |= 32 /* ContainsES2020 */ | propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
13905
+ node.transformFlags |= 32 /* ContainsES2020 */;
13800
13906
  return node;
13801
13907
  }
13802
13908
  function updatePropertyAccessChain(node, expression, questionDotToken, name) {
13803
13909
  Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead.");
13804
13910
  return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node;
13805
13911
  }
13912
+ function createBaseElementAccessExpression(expression, questionDotToken, argumentExpression) {
13913
+ const node = createBaseDeclaration(209 /* ElementAccessExpression */);
13914
+ node.expression = expression;
13915
+ node.questionDotToken = questionDotToken;
13916
+ node.argumentExpression = argumentExpression;
13917
+ node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression);
13918
+ node.jsDoc = void 0;
13919
+ node.jsDocCache = void 0;
13920
+ node.flowNode = void 0;
13921
+ return node;
13922
+ }
13806
13923
  function createElementAccessExpression(expression, index) {
13807
- const node = createBaseExpression(209 /* ElementAccessExpression */);
13808
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
13809
- node.argumentExpression = asExpression(index);
13810
- node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.argumentExpression);
13924
+ const node = createBaseElementAccessExpression(
13925
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false),
13926
+ void 0,
13927
+ asExpression(index)
13928
+ );
13811
13929
  if (isSuperKeyword(expression)) {
13812
13930
  node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */;
13813
13931
  }
@@ -13820,31 +13938,43 @@ function createNodeFactory(flags, baseFactory2) {
13820
13938
  return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node;
13821
13939
  }
13822
13940
  function createElementAccessChain(expression, questionDotToken, index) {
13823
- const node = createBaseExpression(209 /* ElementAccessExpression */);
13941
+ const node = createBaseElementAccessExpression(
13942
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true),
13943
+ questionDotToken,
13944
+ asExpression(index)
13945
+ );
13824
13946
  node.flags |= 32 /* OptionalChain */;
13825
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
13826
- node.questionDotToken = questionDotToken;
13827
- node.argumentExpression = asExpression(index);
13828
- node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression) | 32 /* ContainsES2020 */;
13947
+ node.transformFlags |= 32 /* ContainsES2020 */;
13829
13948
  return node;
13830
13949
  }
13831
13950
  function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) {
13832
13951
  Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead.");
13833
13952
  return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node;
13834
13953
  }
13835
- function createCallExpression(expression, typeArguments, argumentsArray) {
13836
- const node = createBaseExpression(210 /* CallExpression */);
13837
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
13838
- node.typeArguments = asNodeArray(typeArguments);
13839
- node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
13840
- node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments);
13954
+ function createBaseCallExpression(expression, questionDotToken, typeArguments, argumentsArray) {
13955
+ const node = createBaseDeclaration(210 /* CallExpression */);
13956
+ node.expression = expression;
13957
+ node.questionDotToken = questionDotToken;
13958
+ node.typeArguments = typeArguments;
13959
+ node.arguments = argumentsArray;
13960
+ node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments);
13841
13961
  if (node.typeArguments) {
13842
13962
  node.transformFlags |= 1 /* ContainsTypeScript */;
13843
13963
  }
13964
+ if (isSuperProperty(node.expression)) {
13965
+ node.transformFlags |= 16384 /* ContainsLexicalThis */;
13966
+ }
13967
+ return node;
13968
+ }
13969
+ function createCallExpression(expression, typeArguments, argumentsArray) {
13970
+ const node = createBaseCallExpression(
13971
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false),
13972
+ void 0,
13973
+ asNodeArray(typeArguments),
13974
+ parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray))
13975
+ );
13844
13976
  if (isImportKeyword(node.expression)) {
13845
13977
  node.transformFlags |= 8388608 /* ContainsDynamicImport */;
13846
- } else if (isSuperProperty(node.expression)) {
13847
- node.transformFlags |= 16384 /* ContainsLexicalThis */;
13848
13978
  }
13849
13979
  return node;
13850
13980
  }
@@ -13855,19 +13985,14 @@ function createNodeFactory(flags, baseFactory2) {
13855
13985
  return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node;
13856
13986
  }
13857
13987
  function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) {
13858
- const node = createBaseExpression(210 /* CallExpression */);
13988
+ const node = createBaseCallExpression(
13989
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true),
13990
+ questionDotToken,
13991
+ asNodeArray(typeArguments),
13992
+ parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray))
13993
+ );
13859
13994
  node.flags |= 32 /* OptionalChain */;
13860
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
13861
- node.questionDotToken = questionDotToken;
13862
- node.typeArguments = asNodeArray(typeArguments);
13863
- node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
13864
- node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments) | 32 /* ContainsES2020 */;
13865
- if (node.typeArguments) {
13866
- node.transformFlags |= 1 /* ContainsTypeScript */;
13867
- }
13868
- if (isSuperProperty(node.expression)) {
13869
- node.transformFlags |= 16384 /* ContainsLexicalThis */;
13870
- }
13995
+ node.transformFlags |= 32 /* ContainsES2020 */;
13871
13996
  return node;
13872
13997
  }
13873
13998
  function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) {
@@ -13875,7 +14000,7 @@ function createNodeFactory(flags, baseFactory2) {
13875
14000
  return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node;
13876
14001
  }
13877
14002
  function createNewExpression(expression, typeArguments, argumentsArray) {
13878
- const node = createBaseExpression(211 /* NewExpression */);
14003
+ const node = createBaseDeclaration(211 /* NewExpression */);
13879
14004
  node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);
13880
14005
  node.typeArguments = asNodeArray(typeArguments);
13881
14006
  node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0;
@@ -13889,7 +14014,7 @@ function createNodeFactory(flags, baseFactory2) {
13889
14014
  return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node;
13890
14015
  }
13891
14016
  function createTaggedTemplateExpression(tag, typeArguments, template) {
13892
- const node = createBaseExpression(212 /* TaggedTemplateExpression */);
14017
+ const node = createBaseNode(212 /* TaggedTemplateExpression */);
13893
14018
  node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
13894
14019
  node.typeArguments = asNodeArray(typeArguments);
13895
14020
  node.template = template;
@@ -13906,7 +14031,7 @@ function createNodeFactory(flags, baseFactory2) {
13906
14031
  return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node;
13907
14032
  }
13908
14033
  function createTypeAssertion(type, expression) {
13909
- const node = createBaseExpression(213 /* TypeAssertionExpression */);
14034
+ const node = createBaseNode(213 /* TypeAssertionExpression */);
13910
14035
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
13911
14036
  node.type = type;
13912
14037
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -13916,65 +14041,67 @@ function createNodeFactory(flags, baseFactory2) {
13916
14041
  return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node;
13917
14042
  }
13918
14043
  function createParenthesizedExpression(expression) {
13919
- const node = createBaseExpression(214 /* ParenthesizedExpression */);
14044
+ const node = createBaseNode(214 /* ParenthesizedExpression */);
13920
14045
  node.expression = expression;
13921
14046
  node.transformFlags = propagateChildFlags(node.expression);
14047
+ node.jsDoc = void 0;
14048
+ node.jsDocCache = void 0;
13922
14049
  return node;
13923
14050
  }
13924
14051
  function updateParenthesizedExpression(node, expression) {
13925
14052
  return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node;
13926
14053
  }
13927
14054
  function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
13928
- const node = createBaseFunctionLikeDeclaration(
13929
- 215 /* FunctionExpression */,
13930
- modifiers,
13931
- name,
13932
- typeParameters,
13933
- parameters,
13934
- type,
13935
- body
13936
- );
14055
+ const node = createBaseDeclaration(215 /* FunctionExpression */);
14056
+ node.modifiers = asNodeArray(modifiers);
13937
14057
  node.asteriskToken = asteriskToken;
13938
- node.transformFlags |= propagateChildFlags(node.asteriskToken);
13939
- if (node.typeParameters) {
13940
- node.transformFlags |= 1 /* ContainsTypeScript */;
13941
- }
13942
- if (modifiersToFlags(node.modifiers) & 512 /* Async */) {
13943
- if (node.asteriskToken) {
13944
- node.transformFlags |= 128 /* ContainsES2018 */;
13945
- } else {
13946
- node.transformFlags |= 256 /* ContainsES2017 */;
13947
- }
13948
- } else if (node.asteriskToken) {
13949
- node.transformFlags |= 2048 /* ContainsGenerator */;
13950
- }
14058
+ node.name = asName(name);
14059
+ node.typeParameters = asNodeArray(typeParameters);
14060
+ node.parameters = createNodeArray(parameters);
14061
+ node.type = type;
14062
+ node.body = body;
14063
+ const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */;
14064
+ const isGenerator = !!node.asteriskToken;
14065
+ const isAsyncGenerator = isAsync && isGenerator;
14066
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14067
+ node.typeArguments = void 0;
14068
+ node.jsDoc = void 0;
14069
+ node.jsDocCache = void 0;
14070
+ node.locals = void 0;
14071
+ node.nextContainer = void 0;
14072
+ node.flowNode = void 0;
14073
+ node.endFlowNode = void 0;
14074
+ node.returnFlowNode = void 0;
13951
14075
  return node;
13952
14076
  }
13953
14077
  function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
13954
14078
  return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node;
13955
14079
  }
13956
14080
  function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
13957
- const node = createBaseFunctionLikeDeclaration(
13958
- 216 /* ArrowFunction */,
13959
- modifiers,
13960
- void 0,
13961
- typeParameters,
13962
- parameters,
13963
- type,
13964
- parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)
13965
- );
14081
+ const node = createBaseDeclaration(216 /* ArrowFunction */);
14082
+ node.modifiers = asNodeArray(modifiers);
14083
+ node.typeParameters = asNodeArray(typeParameters);
14084
+ node.parameters = createNodeArray(parameters);
14085
+ node.type = type;
13966
14086
  node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */);
13967
- node.transformFlags |= propagateChildFlags(node.equalsGreaterThanToken) | 1024 /* ContainsES2015 */;
13968
- if (modifiersToFlags(node.modifiers) & 512 /* Async */) {
13969
- node.transformFlags |= 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */;
13970
- }
14087
+ node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body);
14088
+ const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */;
14089
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */;
14090
+ node.typeArguments = void 0;
14091
+ node.jsDoc = void 0;
14092
+ node.jsDocCache = void 0;
14093
+ node.locals = void 0;
14094
+ node.nextContainer = void 0;
14095
+ node.flowNode = void 0;
14096
+ node.endFlowNode = void 0;
14097
+ node.returnFlowNode = void 0;
13971
14098
  return node;
13972
14099
  }
13973
14100
  function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
13974
14101
  return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node;
13975
14102
  }
13976
14103
  function createDeleteExpression(expression) {
13977
- const node = createBaseExpression(217 /* DeleteExpression */);
14104
+ const node = createBaseNode(217 /* DeleteExpression */);
13978
14105
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
13979
14106
  node.transformFlags |= propagateChildFlags(node.expression);
13980
14107
  return node;
@@ -13983,7 +14110,7 @@ function createNodeFactory(flags, baseFactory2) {
13983
14110
  return node.expression !== expression ? update(createDeleteExpression(expression), node) : node;
13984
14111
  }
13985
14112
  function createTypeOfExpression(expression) {
13986
- const node = createBaseExpression(218 /* TypeOfExpression */);
14113
+ const node = createBaseNode(218 /* TypeOfExpression */);
13987
14114
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
13988
14115
  node.transformFlags |= propagateChildFlags(node.expression);
13989
14116
  return node;
@@ -13992,7 +14119,7 @@ function createNodeFactory(flags, baseFactory2) {
13992
14119
  return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node;
13993
14120
  }
13994
14121
  function createVoidExpression(expression) {
13995
- const node = createBaseExpression(219 /* VoidExpression */);
14122
+ const node = createBaseNode(219 /* VoidExpression */);
13996
14123
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
13997
14124
  node.transformFlags |= propagateChildFlags(node.expression);
13998
14125
  return node;
@@ -14001,7 +14128,7 @@ function createNodeFactory(flags, baseFactory2) {
14001
14128
  return node.expression !== expression ? update(createVoidExpression(expression), node) : node;
14002
14129
  }
14003
14130
  function createAwaitExpression(expression) {
14004
- const node = createBaseExpression(220 /* AwaitExpression */);
14131
+ const node = createBaseNode(220 /* AwaitExpression */);
14005
14132
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
14006
14133
  node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */;
14007
14134
  return node;
@@ -14010,7 +14137,7 @@ function createNodeFactory(flags, baseFactory2) {
14010
14137
  return node.expression !== expression ? update(createAwaitExpression(expression), node) : node;
14011
14138
  }
14012
14139
  function createPrefixUnaryExpression(operator, operand) {
14013
- const node = createBaseExpression(221 /* PrefixUnaryExpression */);
14140
+ const node = createBaseNode(221 /* PrefixUnaryExpression */);
14014
14141
  node.operator = operator;
14015
14142
  node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);
14016
14143
  node.transformFlags |= propagateChildFlags(node.operand);
@@ -14023,7 +14150,7 @@ function createNodeFactory(flags, baseFactory2) {
14023
14150
  return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node;
14024
14151
  }
14025
14152
  function createPostfixUnaryExpression(operand, operator) {
14026
- const node = createBaseExpression(222 /* PostfixUnaryExpression */);
14153
+ const node = createBaseNode(222 /* PostfixUnaryExpression */);
14027
14154
  node.operator = operator;
14028
14155
  node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);
14029
14156
  node.transformFlags |= propagateChildFlags(node.operand);
@@ -14036,7 +14163,7 @@ function createNodeFactory(flags, baseFactory2) {
14036
14163
  return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node;
14037
14164
  }
14038
14165
  function createBinaryExpression(left, operator, right) {
14039
- const node = createBaseExpression(223 /* BinaryExpression */);
14166
+ const node = createBaseDeclaration(223 /* BinaryExpression */);
14040
14167
  const operatorToken = asToken(operator);
14041
14168
  const operatorKind = operatorToken.kind;
14042
14169
  node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);
@@ -14059,6 +14186,8 @@ function createNodeFactory(flags, baseFactory2) {
14059
14186
  if (operatorKind === 101 /* InKeyword */ && isPrivateIdentifier(node.left)) {
14060
14187
  node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */;
14061
14188
  }
14189
+ node.jsDoc = void 0;
14190
+ node.jsDocCache = void 0;
14062
14191
  return node;
14063
14192
  }
14064
14193
  function propagateAssignmentPatternFlags(node) {
@@ -14085,7 +14214,7 @@ function createNodeFactory(flags, baseFactory2) {
14085
14214
  return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node;
14086
14215
  }
14087
14216
  function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
14088
- const node = createBaseExpression(224 /* ConditionalExpression */);
14217
+ const node = createBaseNode(224 /* ConditionalExpression */);
14089
14218
  node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);
14090
14219
  node.questionToken = questionToken != null ? questionToken : createToken(57 /* QuestionToken */);
14091
14220
  node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);
@@ -14098,7 +14227,7 @@ function createNodeFactory(flags, baseFactory2) {
14098
14227
  return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node;
14099
14228
  }
14100
14229
  function createTemplateExpression(head, templateSpans) {
14101
- const node = createBaseExpression(225 /* TemplateExpression */);
14230
+ const node = createBaseNode(225 /* TemplateExpression */);
14102
14231
  node.head = head;
14103
14232
  node.templateSpans = createNodeArray(templateSpans);
14104
14233
  node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */;
@@ -14107,7 +14236,7 @@ function createNodeFactory(flags, baseFactory2) {
14107
14236
  function updateTemplateExpression(node, head, templateSpans) {
14108
14237
  return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression(head, templateSpans), node) : node;
14109
14238
  }
14110
- function createTemplateLiteralLikeNodeChecked(kind, text, rawText, templateFlags = 0 /* None */) {
14239
+ function checkTemplateLiteralLikeNode(kind, text, rawText, templateFlags = 0 /* None */) {
14111
14240
  Debug.assert(!(templateFlags & ~2048 /* TemplateLiteralLikeFlags */), "Unsupported template flags.");
14112
14241
  let cooked = void 0;
14113
14242
  if (rawText !== void 0 && rawText !== text) {
@@ -14124,34 +14253,56 @@ function createNodeFactory(flags, baseFactory2) {
14124
14253
  } else if (cooked !== void 0) {
14125
14254
  Debug.assert(text === cooked, "Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");
14126
14255
  }
14127
- return createTemplateLiteralLikeNode(kind, text, rawText, templateFlags);
14256
+ return text;
14128
14257
  }
14129
- function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) {
14258
+ function getTransformFlagsOfTemplateLiteralLike(templateFlags) {
14259
+ let transformFlags = 1024 /* ContainsES2015 */;
14260
+ if (templateFlags) {
14261
+ transformFlags |= 128 /* ContainsES2018 */;
14262
+ }
14263
+ return transformFlags;
14264
+ }
14265
+ function createTemplateLiteralLikeToken(kind, text, rawText, templateFlags) {
14130
14266
  const node = createBaseToken(kind);
14131
14267
  node.text = text;
14132
14268
  node.rawText = rawText;
14133
14269
  node.templateFlags = templateFlags & 2048 /* TemplateLiteralLikeFlags */;
14134
- node.transformFlags |= 1024 /* ContainsES2015 */;
14135
- if (node.templateFlags) {
14136
- node.transformFlags |= 128 /* ContainsES2018 */;
14137
- }
14270
+ node.transformFlags = getTransformFlagsOfTemplateLiteralLike(node.templateFlags);
14138
14271
  return node;
14139
14272
  }
14273
+ function createTemplateLiteralLikeDeclaration(kind, text, rawText, templateFlags) {
14274
+ const node = createBaseDeclaration(kind);
14275
+ node.text = text;
14276
+ node.rawText = rawText;
14277
+ node.templateFlags = templateFlags & 2048 /* TemplateLiteralLikeFlags */;
14278
+ node.transformFlags = getTransformFlagsOfTemplateLiteralLike(node.templateFlags);
14279
+ return node;
14280
+ }
14281
+ function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) {
14282
+ if (kind === 14 /* NoSubstitutionTemplateLiteral */) {
14283
+ return createTemplateLiteralLikeDeclaration(kind, text, rawText, templateFlags);
14284
+ }
14285
+ return createTemplateLiteralLikeToken(kind, text, rawText, templateFlags);
14286
+ }
14140
14287
  function createTemplateHead(text, rawText, templateFlags) {
14141
- return createTemplateLiteralLikeNodeChecked(15 /* TemplateHead */, text, rawText, templateFlags);
14288
+ text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14289
+ return createTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14142
14290
  }
14143
14291
  function createTemplateMiddle(text, rawText, templateFlags) {
14144
- return createTemplateLiteralLikeNodeChecked(16 /* TemplateMiddle */, text, rawText, templateFlags);
14292
+ text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14293
+ return createTemplateLiteralLikeNode(16 /* TemplateMiddle */, text, rawText, templateFlags);
14145
14294
  }
14146
14295
  function createTemplateTail(text, rawText, templateFlags) {
14147
- return createTemplateLiteralLikeNodeChecked(17 /* TemplateTail */, text, rawText, templateFlags);
14296
+ text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14297
+ return createTemplateLiteralLikeNode(17 /* TemplateTail */, text, rawText, templateFlags);
14148
14298
  }
14149
14299
  function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) {
14150
- return createTemplateLiteralLikeNodeChecked(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags);
14300
+ text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14301
+ return createTemplateLiteralLikeDeclaration(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags);
14151
14302
  }
14152
14303
  function createYieldExpression(asteriskToken, expression) {
14153
14304
  Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression.");
14154
- const node = createBaseExpression(226 /* YieldExpression */);
14305
+ const node = createBaseNode(226 /* YieldExpression */);
14155
14306
  node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
14156
14307
  node.asteriskToken = asteriskToken;
14157
14308
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */;
@@ -14161,7 +14312,7 @@ function createNodeFactory(flags, baseFactory2) {
14161
14312
  return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node;
14162
14313
  }
14163
14314
  function createSpreadElement(expression) {
14164
- const node = createBaseExpression(227 /* SpreadElement */);
14315
+ const node = createBaseNode(227 /* SpreadElement */);
14165
14316
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
14166
14317
  node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */;
14167
14318
  return node;
@@ -14170,22 +14321,22 @@ function createNodeFactory(flags, baseFactory2) {
14170
14321
  return node.expression !== expression ? update(createSpreadElement(expression), node) : node;
14171
14322
  }
14172
14323
  function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {
14173
- const node = createBaseClassLikeDeclaration(
14174
- 228 /* ClassExpression */,
14175
- modifiers,
14176
- name,
14177
- typeParameters,
14178
- heritageClauses,
14179
- members
14180
- );
14181
- node.transformFlags |= 1024 /* ContainsES2015 */;
14324
+ const node = createBaseDeclaration(228 /* ClassExpression */);
14325
+ node.modifiers = asNodeArray(modifiers);
14326
+ node.name = asName(name);
14327
+ node.typeParameters = asNodeArray(typeParameters);
14328
+ node.heritageClauses = asNodeArray(heritageClauses);
14329
+ node.members = createNodeArray(members);
14330
+ node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
14331
+ node.jsDoc = void 0;
14332
+ node.jsDocCache = void 0;
14182
14333
  return node;
14183
14334
  }
14184
14335
  function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) {
14185
14336
  return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node;
14186
14337
  }
14187
14338
  function createOmittedExpression() {
14188
- return createBaseExpression(229 /* OmittedExpression */);
14339
+ return createBaseNode(229 /* OmittedExpression */);
14189
14340
  }
14190
14341
  function createExpressionWithTypeArguments(expression, typeArguments) {
14191
14342
  const node = createBaseNode(230 /* ExpressionWithTypeArguments */);
@@ -14198,7 +14349,7 @@ function createNodeFactory(flags, baseFactory2) {
14198
14349
  return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node;
14199
14350
  }
14200
14351
  function createAsExpression(expression, type) {
14201
- const node = createBaseExpression(231 /* AsExpression */);
14352
+ const node = createBaseNode(231 /* AsExpression */);
14202
14353
  node.expression = expression;
14203
14354
  node.type = type;
14204
14355
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -14208,7 +14359,7 @@ function createNodeFactory(flags, baseFactory2) {
14208
14359
  return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node;
14209
14360
  }
14210
14361
  function createNonNullExpression(expression) {
14211
- const node = createBaseExpression(232 /* NonNullExpression */);
14362
+ const node = createBaseNode(232 /* NonNullExpression */);
14212
14363
  node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
14213
14364
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
14214
14365
  return node;
@@ -14220,7 +14371,7 @@ function createNodeFactory(flags, baseFactory2) {
14220
14371
  return node.expression !== expression ? update(createNonNullExpression(expression), node) : node;
14221
14372
  }
14222
14373
  function createSatisfiesExpression(expression, type) {
14223
- const node = createBaseExpression(235 /* SatisfiesExpression */);
14374
+ const node = createBaseNode(235 /* SatisfiesExpression */);
14224
14375
  node.expression = expression;
14225
14376
  node.type = type;
14226
14377
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -14230,7 +14381,7 @@ function createNodeFactory(flags, baseFactory2) {
14230
14381
  return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node;
14231
14382
  }
14232
14383
  function createNonNullChain(expression) {
14233
- const node = createBaseExpression(232 /* NonNullExpression */);
14384
+ const node = createBaseNode(232 /* NonNullExpression */);
14234
14385
  node.flags |= 32 /* OptionalChain */;
14235
14386
  node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
14236
14387
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -14241,7 +14392,7 @@ function createNodeFactory(flags, baseFactory2) {
14241
14392
  return node.expression !== expression ? update(createNonNullChain(expression), node) : node;
14242
14393
  }
14243
14394
  function createMetaProperty(keywordToken, name) {
14244
- const node = createBaseExpression(233 /* MetaProperty */);
14395
+ const node = createBaseNode(233 /* MetaProperty */);
14245
14396
  node.keywordToken = keywordToken;
14246
14397
  node.name = name;
14247
14398
  node.transformFlags |= propagateChildFlags(node.name);
@@ -14255,6 +14406,7 @@ function createNodeFactory(flags, baseFactory2) {
14255
14406
  default:
14256
14407
  return Debug.assertNever(keywordToken);
14257
14408
  }
14409
+ node.flowNode = void 0;
14258
14410
  return node;
14259
14411
  }
14260
14412
  function updateMetaProperty(node, name) {
@@ -14280,31 +14432,45 @@ function createNodeFactory(flags, baseFactory2) {
14280
14432
  node.statements = createNodeArray(statements);
14281
14433
  node.multiLine = multiLine;
14282
14434
  node.transformFlags |= propagateChildrenFlags(node.statements);
14435
+ node.jsDoc = void 0;
14436
+ node.jsDocCache = void 0;
14437
+ node.locals = void 0;
14438
+ node.nextContainer = void 0;
14283
14439
  return node;
14284
14440
  }
14285
14441
  function updateBlock(node, statements) {
14286
14442
  return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node;
14287
14443
  }
14288
14444
  function createVariableStatement(modifiers, declarationList) {
14289
- const node = createBaseDeclaration(240 /* VariableStatement */);
14445
+ const node = createBaseNode(240 /* VariableStatement */);
14290
14446
  node.modifiers = asNodeArray(modifiers);
14291
14447
  node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
14292
14448
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
14293
14449
  if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
14294
14450
  node.transformFlags = 1 /* ContainsTypeScript */;
14295
14451
  }
14452
+ node.illegalDecorators = void 0;
14453
+ node.jsDoc = void 0;
14454
+ node.jsDocCache = void 0;
14455
+ node.flowNode = void 0;
14296
14456
  return node;
14297
14457
  }
14298
14458
  function updateVariableStatement(node, modifiers, declarationList) {
14299
14459
  return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node;
14300
14460
  }
14301
14461
  function createEmptyStatement() {
14302
- return createBaseNode(239 /* EmptyStatement */);
14462
+ const node = createBaseNode(239 /* EmptyStatement */);
14463
+ node.jsDoc = void 0;
14464
+ node.jsDocCache = void 0;
14465
+ return node;
14303
14466
  }
14304
14467
  function createExpressionStatement(expression) {
14305
14468
  const node = createBaseNode(241 /* ExpressionStatement */);
14306
14469
  node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
14307
14470
  node.transformFlags |= propagateChildFlags(node.expression);
14471
+ node.jsDoc = void 0;
14472
+ node.jsDocCache = void 0;
14473
+ node.flowNode = void 0;
14308
14474
  return node;
14309
14475
  }
14310
14476
  function updateExpressionStatement(node, expression) {
@@ -14316,6 +14482,9 @@ function createNodeFactory(flags, baseFactory2) {
14316
14482
  node.thenStatement = asEmbeddedStatement(thenStatement);
14317
14483
  node.elseStatement = asEmbeddedStatement(elseStatement);
14318
14484
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement);
14485
+ node.jsDoc = void 0;
14486
+ node.jsDocCache = void 0;
14487
+ node.flowNode = void 0;
14319
14488
  return node;
14320
14489
  }
14321
14490
  function updateIfStatement(node, expression, thenStatement, elseStatement) {
@@ -14326,6 +14495,9 @@ function createNodeFactory(flags, baseFactory2) {
14326
14495
  node.statement = asEmbeddedStatement(statement);
14327
14496
  node.expression = expression;
14328
14497
  node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
14498
+ node.jsDoc = void 0;
14499
+ node.jsDocCache = void 0;
14500
+ node.flowNode = void 0;
14329
14501
  return node;
14330
14502
  }
14331
14503
  function updateDoStatement(node, statement, expression) {
@@ -14336,6 +14508,9 @@ function createNodeFactory(flags, baseFactory2) {
14336
14508
  node.expression = expression;
14337
14509
  node.statement = asEmbeddedStatement(statement);
14338
14510
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
14511
+ node.jsDoc = void 0;
14512
+ node.jsDocCache = void 0;
14513
+ node.flowNode = void 0;
14339
14514
  return node;
14340
14515
  }
14341
14516
  function updateWhileStatement(node, expression, statement) {
@@ -14348,6 +14523,11 @@ function createNodeFactory(flags, baseFactory2) {
14348
14523
  node.incrementor = incrementor;
14349
14524
  node.statement = asEmbeddedStatement(statement);
14350
14525
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement);
14526
+ node.jsDoc = void 0;
14527
+ node.jsDocCache = void 0;
14528
+ node.locals = void 0;
14529
+ node.nextContainer = void 0;
14530
+ node.flowNode = void 0;
14351
14531
  return node;
14352
14532
  }
14353
14533
  function updateForStatement(node, initializer, condition, incrementor, statement) {
@@ -14359,6 +14539,11 @@ function createNodeFactory(flags, baseFactory2) {
14359
14539
  node.expression = expression;
14360
14540
  node.statement = asEmbeddedStatement(statement);
14361
14541
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
14542
+ node.jsDoc = void 0;
14543
+ node.jsDocCache = void 0;
14544
+ node.locals = void 0;
14545
+ node.nextContainer = void 0;
14546
+ node.flowNode = void 0;
14362
14547
  return node;
14363
14548
  }
14364
14549
  function updateForInStatement(node, initializer, expression, statement) {
@@ -14373,6 +14558,11 @@ function createNodeFactory(flags, baseFactory2) {
14373
14558
  node.transformFlags |= propagateChildFlags(node.awaitModifier) | propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement) | 1024 /* ContainsES2015 */;
14374
14559
  if (awaitModifier)
14375
14560
  node.transformFlags |= 128 /* ContainsES2018 */;
14561
+ node.jsDoc = void 0;
14562
+ node.jsDocCache = void 0;
14563
+ node.locals = void 0;
14564
+ node.nextContainer = void 0;
14565
+ node.flowNode = void 0;
14376
14566
  return node;
14377
14567
  }
14378
14568
  function updateForOfStatement(node, awaitModifier, initializer, expression, statement) {
@@ -14382,6 +14572,9 @@ function createNodeFactory(flags, baseFactory2) {
14382
14572
  const node = createBaseNode(248 /* ContinueStatement */);
14383
14573
  node.label = asName(label);
14384
14574
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14575
+ node.jsDoc = void 0;
14576
+ node.jsDocCache = void 0;
14577
+ node.flowNode = void 0;
14385
14578
  return node;
14386
14579
  }
14387
14580
  function updateContinueStatement(node, label) {
@@ -14391,6 +14584,9 @@ function createNodeFactory(flags, baseFactory2) {
14391
14584
  const node = createBaseNode(249 /* BreakStatement */);
14392
14585
  node.label = asName(label);
14393
14586
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14587
+ node.jsDoc = void 0;
14588
+ node.jsDocCache = void 0;
14589
+ node.flowNode = void 0;
14394
14590
  return node;
14395
14591
  }
14396
14592
  function updateBreakStatement(node, label) {
@@ -14400,6 +14596,9 @@ function createNodeFactory(flags, baseFactory2) {
14400
14596
  const node = createBaseNode(250 /* ReturnStatement */);
14401
14597
  node.expression = expression;
14402
14598
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14599
+ node.jsDoc = void 0;
14600
+ node.jsDocCache = void 0;
14601
+ node.flowNode = void 0;
14403
14602
  return node;
14404
14603
  }
14405
14604
  function updateReturnStatement(node, expression) {
@@ -14410,6 +14609,9 @@ function createNodeFactory(flags, baseFactory2) {
14410
14609
  node.expression = expression;
14411
14610
  node.statement = asEmbeddedStatement(statement);
14412
14611
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
14612
+ node.jsDoc = void 0;
14613
+ node.jsDocCache = void 0;
14614
+ node.flowNode = void 0;
14413
14615
  return node;
14414
14616
  }
14415
14617
  function updateWithStatement(node, expression, statement) {
@@ -14420,6 +14622,10 @@ function createNodeFactory(flags, baseFactory2) {
14420
14622
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
14421
14623
  node.caseBlock = caseBlock;
14422
14624
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
14625
+ node.jsDoc = void 0;
14626
+ node.jsDocCache = void 0;
14627
+ node.flowNode = void 0;
14628
+ node.possiblyExhaustive = false;
14423
14629
  return node;
14424
14630
  }
14425
14631
  function updateSwitchStatement(node, expression, caseBlock) {
@@ -14430,6 +14636,9 @@ function createNodeFactory(flags, baseFactory2) {
14430
14636
  node.label = asName(label);
14431
14637
  node.statement = asEmbeddedStatement(statement);
14432
14638
  node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
14639
+ node.jsDoc = void 0;
14640
+ node.jsDocCache = void 0;
14641
+ node.flowNode = void 0;
14433
14642
  return node;
14434
14643
  }
14435
14644
  function updateLabeledStatement(node, label, statement) {
@@ -14439,6 +14648,9 @@ function createNodeFactory(flags, baseFactory2) {
14439
14648
  const node = createBaseNode(254 /* ThrowStatement */);
14440
14649
  node.expression = expression;
14441
14650
  node.transformFlags |= propagateChildFlags(node.expression);
14651
+ node.jsDoc = void 0;
14652
+ node.jsDocCache = void 0;
14653
+ node.flowNode = void 0;
14442
14654
  return node;
14443
14655
  }
14444
14656
  function updateThrowStatement(node, expression) {
@@ -14450,27 +14662,31 @@ function createNodeFactory(flags, baseFactory2) {
14450
14662
  node.catchClause = catchClause;
14451
14663
  node.finallyBlock = finallyBlock;
14452
14664
  node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock);
14665
+ node.jsDoc = void 0;
14666
+ node.jsDocCache = void 0;
14667
+ node.flowNode = void 0;
14453
14668
  return node;
14454
14669
  }
14455
14670
  function updateTryStatement(node, tryBlock, catchClause, finallyBlock) {
14456
14671
  return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node;
14457
14672
  }
14458
14673
  function createDebuggerStatement() {
14459
- return createBaseNode(256 /* DebuggerStatement */);
14674
+ const node = createBaseNode(256 /* DebuggerStatement */);
14675
+ node.jsDoc = void 0;
14676
+ node.jsDocCache = void 0;
14677
+ node.flowNode = void 0;
14678
+ return node;
14460
14679
  }
14461
14680
  function createVariableDeclaration(name, exclamationToken, type, initializer) {
14462
- const node = createBaseVariableLikeDeclaration(
14463
- 257 /* VariableDeclaration */,
14464
- void 0,
14465
- name,
14466
- type,
14467
- initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
14468
- );
14681
+ var _a2;
14682
+ const node = createBaseDeclaration(257 /* VariableDeclaration */);
14683
+ node.name = asName(name);
14469
14684
  node.exclamationToken = exclamationToken;
14470
- node.transformFlags |= propagateChildFlags(node.exclamationToken);
14471
- if (exclamationToken) {
14472
- node.transformFlags |= 1 /* ContainsTypeScript */;
14473
- }
14685
+ node.type = type;
14686
+ node.initializer = asInitializer(initializer);
14687
+ node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */);
14688
+ node.jsDoc = void 0;
14689
+ node.jsDocCache = void 0;
14474
14690
  return node;
14475
14691
  }
14476
14692
  function updateVariableDeclaration(node, name, exclamationToken, type, initializer) {
@@ -14490,31 +14706,30 @@ function createNodeFactory(flags, baseFactory2) {
14490
14706
  return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node;
14491
14707
  }
14492
14708
  function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
14493
- const node = createBaseFunctionLikeDeclaration(
14494
- 259 /* FunctionDeclaration */,
14495
- modifiers,
14496
- name,
14497
- typeParameters,
14498
- parameters,
14499
- type,
14500
- body
14501
- );
14709
+ const node = createBaseDeclaration(259 /* FunctionDeclaration */);
14710
+ node.modifiers = asNodeArray(modifiers);
14502
14711
  node.asteriskToken = asteriskToken;
14712
+ node.name = asName(name);
14713
+ node.typeParameters = asNodeArray(typeParameters);
14714
+ node.parameters = createNodeArray(parameters);
14715
+ node.type = type;
14716
+ node.body = body;
14503
14717
  if (!node.body || modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
14504
14718
  node.transformFlags = 1 /* ContainsTypeScript */;
14505
14719
  } else {
14506
- node.transformFlags |= propagateChildFlags(node.asteriskToken) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14507
- if (modifiersToFlags(node.modifiers) & 512 /* Async */) {
14508
- if (node.asteriskToken) {
14509
- node.transformFlags |= 128 /* ContainsES2018 */;
14510
- } else {
14511
- node.transformFlags |= 256 /* ContainsES2017 */;
14512
- }
14513
- } else if (node.asteriskToken) {
14514
- node.transformFlags |= 2048 /* ContainsGenerator */;
14515
- }
14720
+ const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */;
14721
+ const isGenerator = !!node.asteriskToken;
14722
+ const isAsyncGenerator = isAsync && isGenerator;
14723
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14516
14724
  }
14517
14725
  node.illegalDecorators = void 0;
14726
+ node.typeArguments = void 0;
14727
+ node.jsDoc = void 0;
14728
+ node.jsDocCache = void 0;
14729
+ node.locals = void 0;
14730
+ node.nextContainer = void 0;
14731
+ node.endFlowNode = void 0;
14732
+ node.returnFlowNode = void 0;
14518
14733
  return node;
14519
14734
  }
14520
14735
  function updateFunctionDeclaration(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
@@ -14527,38 +14742,38 @@ function createNodeFactory(flags, baseFactory2) {
14527
14742
  return finishUpdateBaseSignatureDeclaration(updated, original);
14528
14743
  }
14529
14744
  function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
14530
- const node = createBaseClassLikeDeclaration(
14531
- 260 /* ClassDeclaration */,
14532
- modifiers,
14533
- name,
14534
- typeParameters,
14535
- heritageClauses,
14536
- members
14537
- );
14745
+ const node = createBaseDeclaration(260 /* ClassDeclaration */);
14746
+ node.modifiers = asNodeArray(modifiers);
14747
+ node.name = asName(name);
14748
+ node.typeParameters = asNodeArray(typeParameters);
14749
+ node.heritageClauses = asNodeArray(heritageClauses);
14750
+ node.members = createNodeArray(members);
14538
14751
  if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
14539
14752
  node.transformFlags = 1 /* ContainsTypeScript */;
14540
14753
  } else {
14541
- node.transformFlags |= 1024 /* ContainsES2015 */;
14754
+ node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
14542
14755
  if (node.transformFlags & 8192 /* ContainsTypeScriptClassSyntax */) {
14543
14756
  node.transformFlags |= 1 /* ContainsTypeScript */;
14544
14757
  }
14545
14758
  }
14759
+ node.jsDoc = void 0;
14760
+ node.jsDocCache = void 0;
14546
14761
  return node;
14547
14762
  }
14548
14763
  function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
14549
14764
  return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node;
14550
14765
  }
14551
14766
  function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
14552
- const node = createBaseInterfaceOrClassLikeDeclaration(
14553
- 261 /* InterfaceDeclaration */,
14554
- modifiers,
14555
- name,
14556
- typeParameters,
14557
- heritageClauses
14558
- );
14767
+ const node = createBaseDeclaration(261 /* InterfaceDeclaration */);
14768
+ node.modifiers = asNodeArray(modifiers);
14769
+ node.name = asName(name);
14770
+ node.typeParameters = asNodeArray(typeParameters);
14771
+ node.heritageClauses = asNodeArray(heritageClauses);
14559
14772
  node.members = createNodeArray(members);
14560
14773
  node.transformFlags = 1 /* ContainsTypeScript */;
14561
14774
  node.illegalDecorators = void 0;
14775
+ node.jsDoc = void 0;
14776
+ node.jsDocCache = void 0;
14562
14777
  return node;
14563
14778
  }
14564
14779
  function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -14571,15 +14786,17 @@ function createNodeFactory(flags, baseFactory2) {
14571
14786
  return update(updated, original);
14572
14787
  }
14573
14788
  function createTypeAliasDeclaration(modifiers, name, typeParameters, type) {
14574
- const node = createBaseGenericNamedDeclaration(
14575
- 262 /* TypeAliasDeclaration */,
14576
- modifiers,
14577
- name,
14578
- typeParameters
14579
- );
14789
+ const node = createBaseDeclaration(262 /* TypeAliasDeclaration */);
14790
+ node.modifiers = asNodeArray(modifiers);
14791
+ node.name = asName(name);
14792
+ node.typeParameters = asNodeArray(typeParameters);
14580
14793
  node.type = type;
14581
14794
  node.transformFlags = 1 /* ContainsTypeScript */;
14582
14795
  node.illegalDecorators = void 0;
14796
+ node.jsDoc = void 0;
14797
+ node.jsDocCache = void 0;
14798
+ node.locals = void 0;
14799
+ node.nextContainer = void 0;
14583
14800
  return node;
14584
14801
  }
14585
14802
  function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) {
@@ -14592,15 +14809,15 @@ function createNodeFactory(flags, baseFactory2) {
14592
14809
  return update(updated, original);
14593
14810
  }
14594
14811
  function createEnumDeclaration(modifiers, name, members) {
14595
- const node = createBaseNamedDeclaration(
14596
- 263 /* EnumDeclaration */,
14597
- modifiers,
14598
- name
14599
- );
14812
+ const node = createBaseDeclaration(263 /* EnumDeclaration */);
14813
+ node.modifiers = asNodeArray(modifiers);
14814
+ node.name = asName(name);
14600
14815
  node.members = createNodeArray(members);
14601
- node.transformFlags |= propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */;
14816
+ node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */;
14602
14817
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14603
14818
  node.illegalDecorators = void 0;
14819
+ node.jsDoc = void 0;
14820
+ node.jsDocCache = void 0;
14604
14821
  return node;
14605
14822
  }
14606
14823
  function updateEnumDeclaration(node, modifiers, name, members) {
@@ -14625,6 +14842,10 @@ function createNodeFactory(flags, baseFactory2) {
14625
14842
  }
14626
14843
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14627
14844
  node.illegalDecorators = void 0;
14845
+ node.jsDoc = void 0;
14846
+ node.jsDocCache = void 0;
14847
+ node.locals = void 0;
14848
+ node.nextContainer = void 0;
14628
14849
  return node;
14629
14850
  }
14630
14851
  function updateModuleDeclaration(node, modifiers, name, body) {
@@ -14640,6 +14861,8 @@ function createNodeFactory(flags, baseFactory2) {
14640
14861
  const node = createBaseNode(265 /* ModuleBlock */);
14641
14862
  node.statements = createNodeArray(statements);
14642
14863
  node.transformFlags |= propagateChildrenFlags(node.statements);
14864
+ node.jsDoc = void 0;
14865
+ node.jsDocCache = void 0;
14643
14866
  return node;
14644
14867
  }
14645
14868
  function updateModuleBlock(node, statements) {
@@ -14649,20 +14872,21 @@ function createNodeFactory(flags, baseFactory2) {
14649
14872
  const node = createBaseNode(266 /* CaseBlock */);
14650
14873
  node.clauses = createNodeArray(clauses);
14651
14874
  node.transformFlags |= propagateChildrenFlags(node.clauses);
14875
+ node.locals = void 0;
14876
+ node.nextContainer = void 0;
14652
14877
  return node;
14653
14878
  }
14654
14879
  function updateCaseBlock(node, clauses) {
14655
14880
  return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node;
14656
14881
  }
14657
14882
  function createNamespaceExportDeclaration(name) {
14658
- const node = createBaseNamedDeclaration(
14659
- 267 /* NamespaceExportDeclaration */,
14660
- void 0,
14661
- name
14662
- );
14663
- node.transformFlags = 1 /* ContainsTypeScript */;
14883
+ const node = createBaseDeclaration(267 /* NamespaceExportDeclaration */);
14884
+ node.name = asName(name);
14885
+ node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */;
14664
14886
  node.illegalDecorators = void 0;
14665
14887
  node.modifiers = void 0;
14888
+ node.jsDoc = void 0;
14889
+ node.jsDocCache = void 0;
14666
14890
  return node;
14667
14891
  }
14668
14892
  function updateNamespaceExportDeclaration(node, name) {
@@ -14676,18 +14900,19 @@ function createNodeFactory(flags, baseFactory2) {
14676
14900
  return update(updated, original);
14677
14901
  }
14678
14902
  function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) {
14679
- const node = createBaseNamedDeclaration(
14680
- 268 /* ImportEqualsDeclaration */,
14681
- modifiers,
14682
- name
14683
- );
14903
+ const node = createBaseDeclaration(268 /* ImportEqualsDeclaration */);
14904
+ node.modifiers = asNodeArray(modifiers);
14905
+ node.name = asName(name);
14684
14906
  node.isTypeOnly = isTypeOnly;
14685
14907
  node.moduleReference = moduleReference;
14686
- node.transformFlags |= propagateChildFlags(node.moduleReference);
14687
- if (!isExternalModuleReference(node.moduleReference))
14908
+ node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.moduleReference);
14909
+ if (!isExternalModuleReference(node.moduleReference)) {
14688
14910
  node.transformFlags |= 1 /* ContainsTypeScript */;
14911
+ }
14689
14912
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14690
14913
  node.illegalDecorators = void 0;
14914
+ node.jsDoc = void 0;
14915
+ node.jsDocCache = void 0;
14691
14916
  return node;
14692
14917
  }
14693
14918
  function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
@@ -14700,7 +14925,7 @@ function createNodeFactory(flags, baseFactory2) {
14700
14925
  return update(updated, original);
14701
14926
  }
14702
14927
  function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) {
14703
- const node = createBaseDeclaration(269 /* ImportDeclaration */);
14928
+ const node = createBaseNode(269 /* ImportDeclaration */);
14704
14929
  node.modifiers = asNodeArray(modifiers);
14705
14930
  node.importClause = importClause;
14706
14931
  node.moduleSpecifier = moduleSpecifier;
@@ -14708,6 +14933,8 @@ function createNodeFactory(flags, baseFactory2) {
14708
14933
  node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
14709
14934
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14710
14935
  node.illegalDecorators = void 0;
14936
+ node.jsDoc = void 0;
14937
+ node.jsDocCache = void 0;
14711
14938
  return node;
14712
14939
  }
14713
14940
  function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) {
@@ -14720,7 +14947,7 @@ function createNodeFactory(flags, baseFactory2) {
14720
14947
  return update(updated, original);
14721
14948
  }
14722
14949
  function createImportClause(isTypeOnly, name, namedBindings) {
14723
- const node = createBaseNode(270 /* ImportClause */);
14950
+ const node = createBaseDeclaration(270 /* ImportClause */);
14724
14951
  node.isTypeOnly = isTypeOnly;
14725
14952
  node.name = name;
14726
14953
  node.namedBindings = namedBindings;
@@ -14764,7 +14991,7 @@ function createNodeFactory(flags, baseFactory2) {
14764
14991
  return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
14765
14992
  }
14766
14993
  function createNamespaceImport(name) {
14767
- const node = createBaseNode(271 /* NamespaceImport */);
14994
+ const node = createBaseDeclaration(271 /* NamespaceImport */);
14768
14995
  node.name = name;
14769
14996
  node.transformFlags |= propagateChildFlags(node.name);
14770
14997
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -14774,7 +15001,7 @@ function createNodeFactory(flags, baseFactory2) {
14774
15001
  return node.name !== name ? update(createNamespaceImport(name), node) : node;
14775
15002
  }
14776
15003
  function createNamespaceExport(name) {
14777
- const node = createBaseNode(277 /* NamespaceExport */);
15004
+ const node = createBaseDeclaration(277 /* NamespaceExport */);
14778
15005
  node.name = name;
14779
15006
  node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
14780
15007
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -14794,7 +15021,7 @@ function createNodeFactory(flags, baseFactory2) {
14794
15021
  return node.elements !== elements ? update(createNamedImports(elements), node) : node;
14795
15022
  }
14796
15023
  function createImportSpecifier(isTypeOnly, propertyName, name) {
14797
- const node = createBaseNode(273 /* ImportSpecifier */);
15024
+ const node = createBaseDeclaration(273 /* ImportSpecifier */);
14798
15025
  node.isTypeOnly = isTypeOnly;
14799
15026
  node.propertyName = propertyName;
14800
15027
  node.name = name;
@@ -14813,6 +15040,8 @@ function createNodeFactory(flags, baseFactory2) {
14813
15040
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression);
14814
15041
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14815
15042
  node.illegalDecorators = void 0;
15043
+ node.jsDoc = void 0;
15044
+ node.jsDocCache = void 0;
14816
15045
  return node;
14817
15046
  }
14818
15047
  function updateExportAssignment(node, modifiers, expression) {
@@ -14834,6 +15063,8 @@ function createNodeFactory(flags, baseFactory2) {
14834
15063
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
14835
15064
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14836
15065
  node.illegalDecorators = void 0;
15066
+ node.jsDoc = void 0;
15067
+ node.jsDocCache = void 0;
14837
15068
  return node;
14838
15069
  }
14839
15070
  function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
@@ -14862,6 +15093,8 @@ function createNodeFactory(flags, baseFactory2) {
14862
15093
  node.name = asName(name);
14863
15094
  node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name);
14864
15095
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
15096
+ node.jsDoc = void 0;
15097
+ node.jsDocCache = void 0;
14865
15098
  return node;
14866
15099
  }
14867
15100
  function updateExportSpecifier(node, isTypeOnly, propertyName, name) {
@@ -14869,6 +15102,8 @@ function createNodeFactory(flags, baseFactory2) {
14869
15102
  }
14870
15103
  function createMissingDeclaration() {
14871
15104
  const node = createBaseDeclaration(279 /* MissingDeclaration */);
15105
+ node.jsDoc = void 0;
15106
+ node.jsDocCache = void 0;
14872
15107
  return node;
14873
15108
  }
14874
15109
  function createExternalModuleReference(expression) {
@@ -14904,21 +15139,22 @@ function createNodeFactory(flags, baseFactory2) {
14904
15139
  return node.type !== type ? update(createJSDocUnaryTypeWorker(kind, type), node) : node;
14905
15140
  }
14906
15141
  function createJSDocFunctionType(parameters, type) {
14907
- const node = createBaseSignatureDeclaration(
14908
- 320 /* JSDocFunctionType */,
14909
- void 0,
14910
- void 0,
14911
- void 0,
14912
- parameters,
14913
- type
14914
- );
15142
+ const node = createBaseDeclaration(320 /* JSDocFunctionType */);
15143
+ node.parameters = asNodeArray(parameters);
15144
+ node.type = type;
15145
+ node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
15146
+ node.jsDoc = void 0;
15147
+ node.jsDocCache = void 0;
15148
+ node.locals = void 0;
15149
+ node.nextContainer = void 0;
15150
+ node.typeArguments = void 0;
14915
15151
  return node;
14916
15152
  }
14917
15153
  function updateJSDocFunctionType(node, parameters, type) {
14918
15154
  return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node;
14919
15155
  }
14920
15156
  function createJSDocTypeLiteral(propertyTags, isArrayType = false) {
14921
- const node = createBaseNode(325 /* JSDocTypeLiteral */);
15157
+ const node = createBaseDeclaration(325 /* JSDocTypeLiteral */);
14922
15158
  node.jsDocPropertyTags = asNodeArray(propertyTags);
14923
15159
  node.isArrayType = isArrayType;
14924
15160
  return node;
@@ -14935,10 +15171,14 @@ function createNodeFactory(flags, baseFactory2) {
14935
15171
  return node.type !== type ? update(createJSDocTypeExpression(type), node) : node;
14936
15172
  }
14937
15173
  function createJSDocSignature(typeParameters, parameters, type) {
14938
- const node = createBaseNode(326 /* JSDocSignature */);
15174
+ const node = createBaseDeclaration(326 /* JSDocSignature */);
14939
15175
  node.typeParameters = asNodeArray(typeParameters);
14940
15176
  node.parameters = createNodeArray(parameters);
14941
15177
  node.type = type;
15178
+ node.jsDoc = void 0;
15179
+ node.jsDocCache = void 0;
15180
+ node.locals = void 0;
15181
+ node.nextContainer = void 0;
14942
15182
  return node;
14943
15183
  }
14944
15184
  function updateJSDocSignature(node, typeParameters, parameters, type) {
@@ -14954,6 +15194,12 @@ function createNodeFactory(flags, baseFactory2) {
14954
15194
  node.comment = comment;
14955
15195
  return node;
14956
15196
  }
15197
+ function createBaseJSDocTagDeclaration(kind, tagName, comment) {
15198
+ const node = createBaseDeclaration(kind);
15199
+ node.tagName = tagName;
15200
+ node.comment = comment;
15201
+ return node;
15202
+ }
14957
15203
  function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) {
14958
15204
  const node = createBaseJSDocTag(347 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment);
14959
15205
  node.constraint = constraint;
@@ -14964,17 +15210,19 @@ function createNodeFactory(flags, baseFactory2) {
14964
15210
  return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node;
14965
15211
  }
14966
15212
  function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) {
14967
- const node = createBaseJSDocTag(348 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment);
15213
+ const node = createBaseJSDocTagDeclaration(348 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment);
14968
15214
  node.typeExpression = typeExpression;
14969
15215
  node.fullName = fullName;
14970
15216
  node.name = getJSDocTypeAliasName(fullName);
15217
+ node.locals = void 0;
15218
+ node.nextContainer = void 0;
14971
15219
  return node;
14972
15220
  }
14973
15221
  function updateJSDocTypedefTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) {
14974
15222
  return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node;
14975
15223
  }
14976
15224
  function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
14977
- const node = createBaseJSDocTag(343 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment);
15225
+ const node = createBaseJSDocTagDeclaration(343 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment);
14978
15226
  node.typeExpression = typeExpression;
14979
15227
  node.name = name;
14980
15228
  node.isNameFirst = !!isNameFirst;
@@ -14985,7 +15233,7 @@ function createNodeFactory(flags, baseFactory2) {
14985
15233
  return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
14986
15234
  }
14987
15235
  function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
14988
- const node = createBaseJSDocTag(350 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment);
15236
+ const node = createBaseJSDocTagDeclaration(350 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment);
14989
15237
  node.typeExpression = typeExpression;
14990
15238
  node.name = name;
14991
15239
  node.isNameFirst = !!isNameFirst;
@@ -14996,10 +15244,12 @@ function createNodeFactory(flags, baseFactory2) {
14996
15244
  return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
14997
15245
  }
14998
15246
  function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) {
14999
- const node = createBaseJSDocTag(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment);
15247
+ const node = createBaseJSDocTagDeclaration(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment);
15000
15248
  node.typeExpression = typeExpression;
15001
15249
  node.fullName = fullName;
15002
15250
  node.name = getJSDocTypeAliasName(fullName);
15251
+ node.locals = void 0;
15252
+ node.nextContainer = void 0;
15003
15253
  return node;
15004
15254
  }
15005
15255
  function updateJSDocCallbackTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) {
@@ -15096,6 +15346,16 @@ function createNodeFactory(flags, baseFactory2) {
15096
15346
  function updateJSDocUnknownTag(node, tagName, comment) {
15097
15347
  return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node;
15098
15348
  }
15349
+ function createJSDocEnumTag(tagName, typeExpression, comment) {
15350
+ const node = createBaseJSDocTagDeclaration(342 /* JSDocEnumTag */, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(342 /* JSDocEnumTag */)), comment);
15351
+ node.typeExpression = typeExpression;
15352
+ node.locals = void 0;
15353
+ node.nextContainer = void 0;
15354
+ return node;
15355
+ }
15356
+ function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
15357
+ return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node;
15358
+ }
15099
15359
  function createJSDocText(text) {
15100
15360
  const node = createBaseNode(324 /* JSDocText */);
15101
15361
  node.text = text;
@@ -15193,7 +15453,7 @@ function createNodeFactory(flags, baseFactory2) {
15193
15453
  return node;
15194
15454
  }
15195
15455
  function createJsxAttribute(name, initializer) {
15196
- const node = createBaseNode(288 /* JsxAttribute */);
15456
+ const node = createBaseDeclaration(288 /* JsxAttribute */);
15197
15457
  node.name = name;
15198
15458
  node.initializer = initializer;
15199
15459
  node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */;
@@ -15203,7 +15463,7 @@ function createNodeFactory(flags, baseFactory2) {
15203
15463
  return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node;
15204
15464
  }
15205
15465
  function createJsxAttributes(properties) {
15206
- const node = createBaseNode(289 /* JsxAttributes */);
15466
+ const node = createBaseDeclaration(289 /* JsxAttributes */);
15207
15467
  node.properties = createNodeArray(properties);
15208
15468
  node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */;
15209
15469
  return node;
@@ -15235,6 +15495,8 @@ function createNodeFactory(flags, baseFactory2) {
15235
15495
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
15236
15496
  node.statements = createNodeArray(statements);
15237
15497
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
15498
+ node.jsDoc = void 0;
15499
+ node.jsDocCache = void 0;
15238
15500
  return node;
15239
15501
  }
15240
15502
  function updateCaseClause(node, expression, statements) {
@@ -15271,36 +15533,27 @@ function createNodeFactory(flags, baseFactory2) {
15271
15533
  }
15272
15534
  function createCatchClause(variableDeclaration, block) {
15273
15535
  const node = createBaseNode(295 /* CatchClause */);
15274
- if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
15275
- variableDeclaration = createVariableDeclaration(
15276
- variableDeclaration,
15277
- void 0,
15278
- void 0,
15279
- void 0
15280
- );
15281
- }
15282
- node.variableDeclaration = variableDeclaration;
15536
+ node.variableDeclaration = asVariableDeclaration(variableDeclaration);
15283
15537
  node.block = block;
15284
- node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block);
15285
- if (!variableDeclaration)
15286
- node.transformFlags |= 64 /* ContainsES2019 */;
15538
+ node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block) | (!variableDeclaration ? 64 /* ContainsES2019 */ : 0 /* None */);
15539
+ node.locals = void 0;
15540
+ node.nextContainer = void 0;
15287
15541
  return node;
15288
15542
  }
15289
15543
  function updateCatchClause(node, variableDeclaration, block) {
15290
15544
  return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node;
15291
15545
  }
15292
15546
  function createPropertyAssignment(name, initializer) {
15293
- const node = createBaseNamedDeclaration(
15294
- 299 /* PropertyAssignment */,
15295
- void 0,
15296
- name
15297
- );
15547
+ const node = createBaseDeclaration(299 /* PropertyAssignment */);
15548
+ node.name = asName(name);
15298
15549
  node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
15299
- node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer);
15550
+ node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer);
15300
15551
  node.illegalDecorators = void 0;
15301
15552
  node.modifiers = void 0;
15302
15553
  node.questionToken = void 0;
15303
15554
  node.exclamationToken = void 0;
15555
+ node.jsDoc = void 0;
15556
+ node.jsDocCache = void 0;
15304
15557
  return node;
15305
15558
  }
15306
15559
  function updatePropertyAssignment(node, name, initializer) {
@@ -15316,18 +15569,17 @@ function createNodeFactory(flags, baseFactory2) {
15316
15569
  return update(updated, original);
15317
15570
  }
15318
15571
  function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
15319
- const node = createBaseNamedDeclaration(
15320
- 300 /* ShorthandPropertyAssignment */,
15321
- void 0,
15322
- name
15323
- );
15572
+ const node = createBaseDeclaration(300 /* ShorthandPropertyAssignment */);
15573
+ node.name = asName(name);
15324
15574
  node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer);
15325
- node.transformFlags |= propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */;
15575
+ node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */;
15326
15576
  node.equalsToken = void 0;
15327
15577
  node.illegalDecorators = void 0;
15328
15578
  node.modifiers = void 0;
15329
15579
  node.questionToken = void 0;
15330
15580
  node.exclamationToken = void 0;
15581
+ node.jsDoc = void 0;
15582
+ node.jsDocCache = void 0;
15331
15583
  return node;
15332
15584
  }
15333
15585
  function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) {
@@ -15344,19 +15596,23 @@ function createNodeFactory(flags, baseFactory2) {
15344
15596
  return update(updated, original);
15345
15597
  }
15346
15598
  function createSpreadAssignment(expression) {
15347
- const node = createBaseNode(301 /* SpreadAssignment */);
15599
+ const node = createBaseDeclaration(301 /* SpreadAssignment */);
15348
15600
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
15349
15601
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
15602
+ node.jsDoc = void 0;
15603
+ node.jsDocCache = void 0;
15350
15604
  return node;
15351
15605
  }
15352
15606
  function updateSpreadAssignment(node, expression) {
15353
15607
  return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node;
15354
15608
  }
15355
15609
  function createEnumMember(name, initializer) {
15356
- const node = createBaseNode(302 /* EnumMember */);
15610
+ const node = createBaseDeclaration(302 /* EnumMember */);
15357
15611
  node.name = asName(name);
15358
15612
  node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
15359
15613
  node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
15614
+ node.jsDoc = void 0;
15615
+ node.jsDocCache = void 0;
15360
15616
  return node;
15361
15617
  }
15362
15618
  function updateEnumMember(node, name, initializer) {
@@ -15367,33 +15623,111 @@ function createNodeFactory(flags, baseFactory2) {
15367
15623
  node.statements = createNodeArray(statements);
15368
15624
  node.endOfFileToken = endOfFileToken;
15369
15625
  node.flags |= flags2;
15370
- node.fileName = "";
15371
15626
  node.text = "";
15627
+ node.fileName = "";
15628
+ node.path = "";
15629
+ node.resolvedPath = "";
15630
+ node.originalFileName = "";
15372
15631
  node.languageVersion = 0;
15373
15632
  node.languageVariant = 0;
15374
15633
  node.scriptKind = 0;
15375
15634
  node.isDeclarationFile = false;
15376
15635
  node.hasNoDefaultLib = false;
15377
15636
  node.transformFlags |= propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken);
15637
+ node.locals = void 0;
15638
+ node.nextContainer = void 0;
15639
+ node.endFlowNode = void 0;
15640
+ node.nodeCount = 0;
15641
+ node.identifierCount = 0;
15642
+ node.symbolCount = 0;
15643
+ node.parseDiagnostics = void 0;
15644
+ node.bindDiagnostics = void 0;
15645
+ node.bindSuggestionDiagnostics = void 0;
15646
+ node.lineMap = void 0;
15647
+ node.externalModuleIndicator = void 0;
15648
+ node.setExternalModuleIndicator = void 0;
15649
+ node.pragmas = void 0;
15650
+ node.checkJsDirective = void 0;
15651
+ node.referencedFiles = void 0;
15652
+ node.typeReferenceDirectives = void 0;
15653
+ node.libReferenceDirectives = void 0;
15654
+ node.amdDependencies = void 0;
15655
+ node.commentDirectives = void 0;
15656
+ node.identifiers = void 0;
15657
+ node.packageJsonLocations = void 0;
15658
+ node.packageJsonScope = void 0;
15659
+ node.imports = void 0;
15660
+ node.moduleAugmentations = void 0;
15661
+ node.ambientModuleNames = void 0;
15662
+ node.resolvedModules = void 0;
15663
+ node.classifiableNames = void 0;
15664
+ node.impliedNodeFormat = void 0;
15378
15665
  return node;
15379
15666
  }
15380
- function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
15381
- const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(308 /* SourceFile */);
15667
+ function createRedirectedSourceFile(redirectInfo) {
15668
+ const node = Object.create(redirectInfo.redirectTarget);
15669
+ Object.defineProperties(node, {
15670
+ id: {
15671
+ get() {
15672
+ return this.redirectInfo.redirectTarget.id;
15673
+ },
15674
+ set(value) {
15675
+ this.redirectInfo.redirectTarget.id = value;
15676
+ }
15677
+ },
15678
+ symbol: {
15679
+ get() {
15680
+ return this.redirectInfo.redirectTarget.symbol;
15681
+ },
15682
+ set(value) {
15683
+ this.redirectInfo.redirectTarget.symbol = value;
15684
+ }
15685
+ }
15686
+ });
15687
+ node.redirectInfo = redirectInfo;
15688
+ return node;
15689
+ }
15690
+ function cloneRedirectedSourceFile(source) {
15691
+ const node = createRedirectedSourceFile(source.redirectInfo);
15692
+ node.flags |= source.flags & ~8 /* Synthesized */;
15693
+ node.fileName = source.fileName;
15694
+ node.path = source.path;
15695
+ node.resolvedPath = source.resolvedPath;
15696
+ node.originalFileName = source.originalFileName;
15697
+ node.packageJsonLocations = source.packageJsonLocations;
15698
+ node.packageJsonScope = source.packageJsonScope;
15699
+ node.emitNode = void 0;
15700
+ return node;
15701
+ }
15702
+ function cloneSourceFileWorker(source) {
15703
+ const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */);
15704
+ node.flags |= source.flags & ~8 /* Synthesized */;
15382
15705
  for (const p in source) {
15383
- if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p))
15706
+ if (hasProperty(node, p) || !hasProperty(source, p)) {
15707
+ continue;
15708
+ }
15709
+ if (p === "emitNode") {
15710
+ node.emitNode = void 0;
15384
15711
  continue;
15712
+ }
15385
15713
  node[p] = source[p];
15386
15714
  }
15387
- node.flags |= source.flags;
15715
+ return node;
15716
+ }
15717
+ function cloneSourceFile(source) {
15718
+ const node = source.redirectInfo ? cloneRedirectedSourceFile(source) : cloneSourceFileWorker(source);
15719
+ setOriginalNode(node, source);
15720
+ return node;
15721
+ }
15722
+ function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
15723
+ const node = cloneSourceFile(source);
15388
15724
  node.statements = createNodeArray(statements);
15389
- node.endOfFileToken = source.endOfFileToken;
15390
15725
  node.isDeclarationFile = isDeclarationFile;
15391
15726
  node.referencedFiles = referencedFiles;
15392
15727
  node.typeReferenceDirectives = typeReferences;
15393
15728
  node.hasNoDefaultLib = hasNoDefaultLib;
15394
15729
  node.libReferenceDirectives = libReferences;
15395
15730
  node.transformFlags = propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken);
15396
- node.impliedNodeFormat = source.impliedNodeFormat;
15397
15731
  return node;
15398
15732
  }
15399
15733
  function updateSourceFile(node, statements, isDeclarationFile = node.isDeclarationFile, referencedFiles = node.referencedFiles, typeReferenceDirectives = node.typeReferenceDirectives, hasNoDefaultLib = node.hasNoDefaultLib, libReferenceDirectives = node.libReferenceDirectives) {
@@ -15403,6 +15737,10 @@ function createNodeFactory(flags, baseFactory2) {
15403
15737
  const node = createBaseNode(309 /* Bundle */);
15404
15738
  node.prepends = prepends;
15405
15739
  node.sourceFiles = sourceFiles;
15740
+ node.syntheticFileReferences = void 0;
15741
+ node.syntheticTypeReferences = void 0;
15742
+ node.syntheticLibReferences = void 0;
15743
+ node.hasNoDefaultLib = void 0;
15406
15744
  return node;
15407
15745
  }
15408
15746
  function updateBundle(node, sourceFiles, prepends = emptyArray) {
@@ -15519,11 +15857,68 @@ function createNodeFactory(flags, baseFactory2) {
15519
15857
  function updateSyntheticReferenceExpression(node, expression, thisArg) {
15520
15858
  return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node;
15521
15859
  }
15860
+ function cloneGeneratedIdentifier(node) {
15861
+ const clone2 = createBaseIdentifier(node.escapedText, void 0);
15862
+ clone2.flags |= node.flags & ~8 /* Synthesized */;
15863
+ clone2.autoGenerateFlags = node.autoGenerateFlags;
15864
+ clone2.autoGenerateId = node.autoGenerateId;
15865
+ clone2.autoGeneratePrefix = node.autoGeneratePrefix;
15866
+ clone2.autoGenerateSuffix = node.autoGenerateSuffix;
15867
+ clone2.transformFlags = node.transformFlags;
15868
+ setOriginalNode(clone2, node);
15869
+ return clone2;
15870
+ }
15871
+ function cloneIdentifier(node) {
15872
+ const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind);
15873
+ clone2.flags |= node.flags & ~8 /* Synthesized */;
15874
+ clone2.typeArguments = node.typeArguments;
15875
+ clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape;
15876
+ clone2.jsDoc = node.jsDoc;
15877
+ clone2.jsDocCache = node.jsDocCache;
15878
+ clone2.flowNode = node.flowNode;
15879
+ clone2.symbol = node.symbol;
15880
+ clone2.transformFlags = node.transformFlags;
15881
+ setOriginalNode(clone2, node);
15882
+ return clone2;
15883
+ }
15884
+ function cloneGeneratedPrivateIdentifier(node) {
15885
+ const clone2 = createBasePrivateIdentifier(node.escapedText);
15886
+ clone2.flags |= node.flags & ~8 /* Synthesized */;
15887
+ clone2.autoGenerateFlags = node.autoGenerateFlags;
15888
+ clone2.autoGenerateId = node.autoGenerateId;
15889
+ clone2.autoGeneratePrefix = node.autoGeneratePrefix;
15890
+ clone2.autoGenerateSuffix = node.autoGenerateSuffix;
15891
+ clone2.transformFlags = node.transformFlags;
15892
+ setOriginalNode(clone2, node);
15893
+ return clone2;
15894
+ }
15895
+ function clonePrivateIdentifier(node) {
15896
+ const clone2 = createBasePrivateIdentifier(node.escapedText);
15897
+ clone2.flags |= node.flags & ~8 /* Synthesized */;
15898
+ clone2.transformFlags = node.transformFlags;
15899
+ setOriginalNode(clone2, node);
15900
+ return clone2;
15901
+ }
15522
15902
  function cloneNode(node) {
15523
15903
  if (node === void 0) {
15524
15904
  return node;
15525
15905
  }
15526
- const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(308 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
15906
+ if (isSourceFile(node)) {
15907
+ return cloneSourceFile(node);
15908
+ }
15909
+ if (isGeneratedIdentifier(node)) {
15910
+ return cloneGeneratedIdentifier(node);
15911
+ }
15912
+ if (isIdentifier(node)) {
15913
+ return cloneIdentifier(node);
15914
+ }
15915
+ if (isGeneratedPrivateIdentifier(node)) {
15916
+ return cloneGeneratedPrivateIdentifier(node);
15917
+ }
15918
+ if (isPrivateIdentifier(node)) {
15919
+ return clonePrivateIdentifier(node);
15920
+ }
15921
+ const clone2 = !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
15527
15922
  clone2.flags |= node.flags & ~8 /* Synthesized */;
15528
15923
  clone2.transformFlags = node.transformFlags;
15529
15924
  setOriginalNode(clone2, node);
@@ -15962,12 +16357,26 @@ function createNodeFactory(flags, baseFactory2) {
15962
16357
  function asExpression(value) {
15963
16358
  return typeof value === "string" ? createStringLiteral(value) : typeof value === "number" ? createNumericLiteral(value) : typeof value === "boolean" ? value ? createTrue() : createFalse() : value;
15964
16359
  }
16360
+ function asInitializer(node) {
16361
+ return node && parenthesizerRules().parenthesizeExpressionForDisallowedComma(node);
16362
+ }
15965
16363
  function asToken(value) {
15966
16364
  return typeof value === "number" ? createToken(value) : value;
15967
16365
  }
15968
16366
  function asEmbeddedStatement(statement) {
15969
16367
  return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement;
15970
16368
  }
16369
+ function asVariableDeclaration(variableDeclaration) {
16370
+ if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
16371
+ return createVariableDeclaration(
16372
+ variableDeclaration,
16373
+ void 0,
16374
+ void 0,
16375
+ void 0
16376
+ );
16377
+ }
16378
+ return variableDeclaration;
16379
+ }
15971
16380
  }
15972
16381
  function updateWithoutOriginal(updated, original) {
15973
16382
  if (updated !== original) {
@@ -16068,6 +16477,9 @@ function getCookedText(kind, rawText) {
16068
16477
  rawTextScanner.setText(void 0);
16069
16478
  return tokenValue;
16070
16479
  }
16480
+ function propagateNameFlags(node) {
16481
+ return node && isIdentifier(node) ? propagateIdentifierNameFlags(node) : propagateChildFlags(node);
16482
+ }
16071
16483
  function propagateIdentifierNameFlags(node) {
16072
16484
  return propagateChildFlags(node) & ~67108864 /* ContainsPossibleTopLevelAwait */;
16073
16485
  }
@@ -18725,7 +19137,7 @@ var Parser;
18725
19137
  if (!canReuseNode(node, parsingContext2)) {
18726
19138
  return void 0;
18727
19139
  }
18728
- if (node.jsDocCache) {
19140
+ if (canHaveJSDoc(node) && node.jsDocCache) {
18729
19141
  node.jsDocCache = void 0;
18730
19142
  }
18731
19143
  return node;
@@ -25385,15 +25797,6 @@ var commandLineTypeAcquisitionMapCache;
25385
25797
  function getCommandLineTypeAcquisitionMap() {
25386
25798
  return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(typeAcquisitionDeclarations));
25387
25799
  }
25388
- var extendsOptionDeclaration = {
25389
- name: "extends",
25390
- type: "listOrElement",
25391
- element: {
25392
- name: "extends",
25393
- type: "string"
25394
- },
25395
- category: Diagnostics.File_Management
25396
- };
25397
25800
  var _tsconfigRootOptions;
25398
25801
  function getTsconfigRootOptionsMap() {
25399
25802
  if (_tsconfigRootOptions === void 0) {
@@ -25425,7 +25828,11 @@ function getTsconfigRootOptionsMap() {
25425
25828
  elementOptions: getCommandLineTypeAcquisitionMap(),
25426
25829
  extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
25427
25830
  },
25428
- extendsOptionDeclaration,
25831
+ {
25832
+ name: "extends",
25833
+ type: "string",
25834
+ category: Diagnostics.File_Management
25835
+ },
25429
25836
  {
25430
25837
  name: "references",
25431
25838
  type: "list",
@@ -25560,10 +25967,10 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25560
25967
  let invalidReported;
25561
25968
  switch (valueExpression.kind) {
25562
25969
  case 110 /* TrueKeyword */:
25563
- reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
25970
+ reportInvalidOptionValue(option && option.type !== "boolean");
25564
25971
  return validateValue(true);
25565
25972
  case 95 /* FalseKeyword */:
25566
- reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
25973
+ reportInvalidOptionValue(option && option.type !== "boolean");
25567
25974
  return validateValue(false);
25568
25975
  case 104 /* NullKeyword */:
25569
25976
  reportInvalidOptionValue(option && option.name === "extends");
@@ -25572,11 +25979,8 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25572
25979
  if (!isDoubleQuotedString(valueExpression)) {
25573
25980
  errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected));
25574
25981
  }
25575
- reportInvalidOptionValue(option && isString(option.type) && option.type !== "string" && (option.type !== "listOrElement" || isString(option.element.type) && option.element.type !== "string"));
25982
+ reportInvalidOptionValue(option && (isString(option.type) && option.type !== "string"));
25576
25983
  const text = valueExpression.text;
25577
- if (option) {
25578
- Debug.assert(option.type !== "listOrElement" || option.element.type === "string", "Only string or array of string is handled for now");
25579
- }
25580
25984
  if (option && !isString(option.type)) {
25581
25985
  const customOption = option;
25582
25986
  if (!customOption.type.has(text.toLowerCase())) {
@@ -25591,16 +25995,16 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25591
25995
  }
25592
25996
  return validateValue(text);
25593
25997
  case 8 /* NumericLiteral */:
25594
- reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
25998
+ reportInvalidOptionValue(option && option.type !== "number");
25595
25999
  return validateValue(Number(valueExpression.text));
25596
26000
  case 221 /* PrefixUnaryExpression */:
25597
26001
  if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
25598
26002
  break;
25599
26003
  }
25600
- reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
26004
+ reportInvalidOptionValue(option && option.type !== "number");
25601
26005
  return validateValue(-Number(valueExpression.operand.text));
25602
26006
  case 207 /* ObjectLiteralExpression */:
25603
- reportInvalidOptionValue(option && option.type !== "object" && (option.type !== "listOrElement" || option.element.type !== "object"));
26007
+ reportInvalidOptionValue(option && option.type !== "object");
25604
26008
  const objectLiteralExpression = valueExpression;
25605
26009
  if (option) {
25606
26010
  const { elementOptions, extraKeyDiagnostics, name: optionName } = option;
@@ -25619,7 +26023,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25619
26023
  ));
25620
26024
  }
25621
26025
  case 206 /* ArrayLiteralExpression */:
25622
- reportInvalidOptionValue(option && option.type !== "list" && option.type !== "listOrElement");
26026
+ reportInvalidOptionValue(option && option.type !== "list");
25623
26027
  return validateValue(convertArrayLiteralExpressionToJson(
25624
26028
  valueExpression.elements,
25625
26029
  option && option.element
@@ -25654,7 +26058,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25654
26058
  }
25655
26059
  }
25656
26060
  function getCompilerOptionValueTypeString(option) {
25657
- return option.type === "listOrElement" ? `${getCompilerOptionValueTypeString(option.element)} or Array` : option.type === "list" ? "Array" : isString(option.type) ? option.type : "string";
26061
+ return option.type === "list" ? "Array" : isString(option.type) ? option.type : "string";
25658
26062
  }
25659
26063
  function isCompilerOptionsValue(option, value) {
25660
26064
  if (option) {
@@ -25663,9 +26067,6 @@ function isCompilerOptionsValue(option, value) {
25663
26067
  if (option.type === "list") {
25664
26068
  return isArray(value);
25665
26069
  }
25666
- if (option.type === "listOrElement") {
25667
- return isArray(value) || isCompilerOptionsValue(option.element, value);
25668
- }
25669
26070
  const expectedType = isString(option.type) ? option.type : "string";
25670
26071
  return typeof value === expectedType;
25671
26072
  }
@@ -27402,13 +27803,14 @@ function createBinder() {
27402
27803
  if (node.kind === 278 /* ExportSpecifier */ || node.kind === 268 /* ImportEqualsDeclaration */ && hasExportModifier) {
27403
27804
  return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
27404
27805
  } else {
27806
+ Debug.assertNode(container, canHaveLocals);
27405
27807
  return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
27406
27808
  }
27407
27809
  } else {
27408
27810
  if (isJSDocTypeAlias(node))
27409
27811
  Debug.assert(isInJSFile(node));
27410
27812
  if (!isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) {
27411
- if (!container.locals || hasSyntacticModifier(node, 1024 /* Default */) && !getDeclarationName(node)) {
27813
+ if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node, 1024 /* Default */) && !getDeclarationName(node)) {
27412
27814
  return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
27413
27815
  }
27414
27816
  const exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0;
@@ -27417,6 +27819,7 @@ function createBinder() {
27417
27819
  node.localSymbol = local;
27418
27820
  return local;
27419
27821
  } else {
27822
+ Debug.assertNode(container, canHaveLocals);
27420
27823
  return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
27421
27824
  }
27422
27825
  }
@@ -27449,11 +27852,13 @@ function createBinder() {
27449
27852
  container = blockScopeContainer = node;
27450
27853
  if (containerFlags & 32 /* HasLocals */) {
27451
27854
  container.locals = createSymbolTable();
27855
+ addToContainerChain(container);
27452
27856
  }
27453
- addToContainerChain(container);
27454
27857
  } else if (containerFlags & 2 /* IsBlockScopedContainer */) {
27455
27858
  blockScopeContainer = node;
27456
- blockScopeContainer.locals = void 0;
27859
+ if (containerFlags & 32 /* HasLocals */) {
27860
+ blockScopeContainer.locals = void 0;
27861
+ }
27457
27862
  }
27458
27863
  if (containerFlags & 4 /* IsControlFlowContainer */) {
27459
27864
  const saveCurrentFlow = currentFlow;
@@ -28418,60 +28823,6 @@ function createBinder() {
28418
28823
  }
28419
28824
  }
28420
28825
  }
28421
- function getContainerFlags(node) {
28422
- switch (node.kind) {
28423
- case 228 /* ClassExpression */:
28424
- case 260 /* ClassDeclaration */:
28425
- case 263 /* EnumDeclaration */:
28426
- case 207 /* ObjectLiteralExpression */:
28427
- case 184 /* TypeLiteral */:
28428
- case 325 /* JSDocTypeLiteral */:
28429
- case 289 /* JsxAttributes */:
28430
- return 1 /* IsContainer */;
28431
- case 261 /* InterfaceDeclaration */:
28432
- return 1 /* IsContainer */ | 64 /* IsInterface */;
28433
- case 264 /* ModuleDeclaration */:
28434
- case 262 /* TypeAliasDeclaration */:
28435
- case 197 /* MappedType */:
28436
- case 178 /* IndexSignature */:
28437
- return 1 /* IsContainer */ | 32 /* HasLocals */;
28438
- case 308 /* SourceFile */:
28439
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
28440
- case 174 /* GetAccessor */:
28441
- case 175 /* SetAccessor */:
28442
- case 171 /* MethodDeclaration */:
28443
- if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
28444
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
28445
- }
28446
- case 173 /* Constructor */:
28447
- case 259 /* FunctionDeclaration */:
28448
- case 170 /* MethodSignature */:
28449
- case 176 /* CallSignature */:
28450
- case 326 /* JSDocSignature */:
28451
- case 320 /* JSDocFunctionType */:
28452
- case 181 /* FunctionType */:
28453
- case 177 /* ConstructSignature */:
28454
- case 182 /* ConstructorType */:
28455
- case 172 /* ClassStaticBlockDeclaration */:
28456
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
28457
- case 215 /* FunctionExpression */:
28458
- case 216 /* ArrowFunction */:
28459
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
28460
- case 265 /* ModuleBlock */:
28461
- return 4 /* IsControlFlowContainer */;
28462
- case 169 /* PropertyDeclaration */:
28463
- return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
28464
- case 295 /* CatchClause */:
28465
- case 245 /* ForStatement */:
28466
- case 246 /* ForInStatement */:
28467
- case 247 /* ForOfStatement */:
28468
- case 266 /* CaseBlock */:
28469
- return 2 /* IsBlockScopedContainer */;
28470
- case 238 /* Block */:
28471
- return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
28472
- }
28473
- return 0 /* None */;
28474
- }
28475
28826
  function addToContainerChain(next) {
28476
28827
  if (lastContainer) {
28477
28828
  lastContainer.nextContainer = next;
@@ -28510,11 +28861,11 @@ function createBinder() {
28510
28861
  case 215 /* FunctionExpression */:
28511
28862
  case 216 /* ArrowFunction */:
28512
28863
  case 320 /* JSDocFunctionType */:
28513
- case 348 /* JSDocTypedefTag */:
28514
- case 341 /* JSDocCallbackTag */:
28515
28864
  case 172 /* ClassStaticBlockDeclaration */:
28516
28865
  case 262 /* TypeAliasDeclaration */:
28517
28866
  case 197 /* MappedType */:
28867
+ if (container.locals)
28868
+ Debug.assertNode(container, canHaveLocals);
28518
28869
  return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
28519
28870
  }
28520
28871
  }
@@ -28609,6 +28960,7 @@ function createBinder() {
28609
28960
  break;
28610
28961
  }
28611
28962
  default:
28963
+ Debug.assertNode(blockScopeContainer, canHaveLocals);
28612
28964
  if (!blockScopeContainer.locals) {
28613
28965
  blockScopeContainer.locals = createSymbolTable();
28614
28966
  addToContainerChain(blockScopeContainer);
@@ -29265,7 +29617,7 @@ function createBinder() {
29265
29617
  if (hasPrivateIdentifier) {
29266
29618
  return;
29267
29619
  }
29268
- const thisContainer = getThisContainer(node, false);
29620
+ const thisContainer = getThisContainer(node, false, false);
29269
29621
  switch (thisContainer.kind) {
29270
29622
  case 259 /* FunctionDeclaration */:
29271
29623
  case 215 /* FunctionExpression */:
@@ -29598,12 +29950,12 @@ function createBinder() {
29598
29950
  return extendsType && extendsType.parent;
29599
29951
  }
29600
29952
  function bindTypeParameter(node) {
29953
+ var _a2, _b;
29601
29954
  if (isJSDocTemplateTag(node.parent)) {
29602
29955
  const container2 = getEffectiveContainerForJSDocTemplateTag(node.parent);
29603
29956
  if (container2) {
29604
- if (!container2.locals) {
29605
- container2.locals = createSymbolTable();
29606
- }
29957
+ Debug.assertNode(container2, canHaveLocals);
29958
+ (_a2 = container2.locals) != null ? _a2 : container2.locals = createSymbolTable();
29607
29959
  declareSymbol(container2.locals, void 0, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
29608
29960
  } else {
29609
29961
  declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
@@ -29611,9 +29963,8 @@ function createBinder() {
29611
29963
  } else if (node.parent.kind === 192 /* InferType */) {
29612
29964
  const container2 = getInferTypeContainer(node.parent);
29613
29965
  if (container2) {
29614
- if (!container2.locals) {
29615
- container2.locals = createSymbolTable();
29616
- }
29966
+ Debug.assertNode(container2, canHaveLocals);
29967
+ (_b = container2.locals) != null ? _b : container2.locals = createSymbolTable();
29617
29968
  declareSymbol(container2.locals, void 0, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
29618
29969
  } else {
29619
29970
  bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node));
@@ -29691,15 +30042,72 @@ function isExportsOrModuleExportsOrAlias(sourceFile, node) {
29691
30042
  }
29692
30043
  return false;
29693
30044
  }
30045
+ function getContainerFlags(node) {
30046
+ switch (node.kind) {
30047
+ case 228 /* ClassExpression */:
30048
+ case 260 /* ClassDeclaration */:
30049
+ case 263 /* EnumDeclaration */:
30050
+ case 207 /* ObjectLiteralExpression */:
30051
+ case 184 /* TypeLiteral */:
30052
+ case 325 /* JSDocTypeLiteral */:
30053
+ case 289 /* JsxAttributes */:
30054
+ return 1 /* IsContainer */;
30055
+ case 261 /* InterfaceDeclaration */:
30056
+ return 1 /* IsContainer */ | 64 /* IsInterface */;
30057
+ case 264 /* ModuleDeclaration */:
30058
+ case 262 /* TypeAliasDeclaration */:
30059
+ case 197 /* MappedType */:
30060
+ case 178 /* IndexSignature */:
30061
+ return 1 /* IsContainer */ | 32 /* HasLocals */;
30062
+ case 308 /* SourceFile */:
30063
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
30064
+ case 174 /* GetAccessor */:
30065
+ case 175 /* SetAccessor */:
30066
+ case 171 /* MethodDeclaration */:
30067
+ if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
30068
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
30069
+ }
30070
+ case 173 /* Constructor */:
30071
+ case 259 /* FunctionDeclaration */:
30072
+ case 170 /* MethodSignature */:
30073
+ case 176 /* CallSignature */:
30074
+ case 326 /* JSDocSignature */:
30075
+ case 320 /* JSDocFunctionType */:
30076
+ case 181 /* FunctionType */:
30077
+ case 177 /* ConstructSignature */:
30078
+ case 182 /* ConstructorType */:
30079
+ case 172 /* ClassStaticBlockDeclaration */:
30080
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
30081
+ case 215 /* FunctionExpression */:
30082
+ case 216 /* ArrowFunction */:
30083
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
30084
+ case 265 /* ModuleBlock */:
30085
+ return 4 /* IsControlFlowContainer */;
30086
+ case 169 /* PropertyDeclaration */:
30087
+ return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
30088
+ case 295 /* CatchClause */:
30089
+ case 245 /* ForStatement */:
30090
+ case 246 /* ForInStatement */:
30091
+ case 247 /* ForOfStatement */:
30092
+ case 266 /* CaseBlock */:
30093
+ return 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */;
30094
+ case 238 /* Block */:
30095
+ return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */;
30096
+ }
30097
+ return 0 /* None */;
30098
+ }
29694
30099
  function lookupSymbolForName(container, name) {
29695
- const local = container.locals && container.locals.get(name);
30100
+ var _a2, _b, _c, _d, _e;
30101
+ const local = (_b = (_a2 = tryCast(container, canHaveLocals)) == null ? void 0 : _a2.locals) == null ? void 0 : _b.get(name);
29696
30102
  if (local) {
29697
- return local.exportSymbol || local;
30103
+ return (_c = local.exportSymbol) != null ? _c : local;
29698
30104
  }
29699
30105
  if (isSourceFile(container) && container.jsGlobalAugmentations && container.jsGlobalAugmentations.has(name)) {
29700
30106
  return container.jsGlobalAugmentations.get(name);
29701
30107
  }
29702
- return container.symbol && container.symbol.exports && container.symbol.exports.get(name);
30108
+ if (canHaveSymbol(container)) {
30109
+ return (_e = (_d = container.symbol) == null ? void 0 : _d.exports) == null ? void 0 : _e.get(name);
30110
+ }
29703
30111
  }
29704
30112
 
29705
30113
  // src/compiler/checker.ts