typescript 5.0.0-dev.20230111 → 5.0.0-dev.20230113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsserver.js CHANGED
@@ -194,6 +194,7 @@ __export(server_exports, {
194
194
  addEmitHelper: () => addEmitHelper,
195
195
  addEmitHelpers: () => addEmitHelpers,
196
196
  addNodeFactoryPatcher: () => addNodeFactoryPatcher,
197
+ addObjectAllocatorPatcher: () => addObjectAllocatorPatcher,
197
198
  addRange: () => addRange,
198
199
  addRelatedInfo: () => addRelatedInfo,
199
200
  addSyntheticLeadingComment: () => addSyntheticLeadingComment,
@@ -962,6 +963,9 @@ __export(server_exports, {
962
963
  getGeneratedNameForNode: () => getGeneratedNameForNode,
963
964
  getHeritageClause: () => getHeritageClause,
964
965
  getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc,
966
+ getIdentifierAutoGenerate: () => getIdentifierAutoGenerate,
967
+ getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference,
968
+ getIdentifierTypeArguments: () => getIdentifierTypeArguments,
965
969
  getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression,
966
970
  getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile,
967
971
  getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker,
@@ -1295,6 +1299,7 @@ __export(server_exports, {
1295
1299
  hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames,
1296
1300
  idText: () => idText,
1297
1301
  identifierIsThisKeyword: () => identifierIsThisKeyword,
1302
+ identifierToKeywordKind: () => identifierToKeywordKind,
1298
1303
  identity: () => identity,
1299
1304
  identitySourceMapConsumer: () => identitySourceMapConsumer,
1300
1305
  ignoreSourceNewlines: () => ignoreSourceNewlines,
@@ -2184,6 +2189,7 @@ __export(server_exports, {
2184
2189
  sameMap: () => sameMap,
2185
2190
  sameMapping: () => sameMapping,
2186
2191
  scanShebangTrivia: () => scanShebangTrivia,
2192
+ scanTokenAtPosition: () => scanTokenAtPosition,
2187
2193
  scanner: () => scanner,
2188
2194
  screenStartingMessageCodes: () => screenStartingMessageCodes,
2189
2195
  semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations,
@@ -2196,6 +2202,9 @@ __export(server_exports, {
2196
2202
  setEachParent: () => setEachParent,
2197
2203
  setEmitFlags: () => setEmitFlags,
2198
2204
  setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned,
2205
+ setIdentifierAutoGenerate: () => setIdentifierAutoGenerate,
2206
+ setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference,
2207
+ setIdentifierTypeArguments: () => setIdentifierTypeArguments,
2199
2208
  setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages,
2200
2209
  setModuleDefaultHelper: () => setModuleDefaultHelper,
2201
2210
  setNodeFlags: () => setNodeFlags,
@@ -2662,7 +2671,7 @@ __export(ts_server_exports3, {
2662
2671
 
2663
2672
  // src/compiler/corePublic.ts
2664
2673
  var versionMajorMinor = "5.0";
2665
- var version = `${versionMajorMinor}.0-dev.20230111`;
2674
+ var version = `${versionMajorMinor}.0-dev.20230113`;
2666
2675
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2667
2676
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2668
2677
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6542,6 +6551,8 @@ var NodeFlags = /* @__PURE__ */ ((NodeFlags4) => {
6542
6551
  NodeFlags4[NodeFlags4["ContextFlags"] = 50720768] = "ContextFlags";
6543
6552
  NodeFlags4[NodeFlags4["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags";
6544
6553
  NodeFlags4[NodeFlags4["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags";
6554
+ NodeFlags4[NodeFlags4["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape";
6555
+ NodeFlags4[NodeFlags4["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace";
6545
6556
  return NodeFlags4;
6546
6557
  })(NodeFlags || {});
6547
6558
  var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => {
@@ -10950,6 +10961,8 @@ var Diagnostics = {
10950
10961
  package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."),
10951
10962
  package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"),
10952
10963
  Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."),
10964
+ Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),
10965
+ There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
10953
10966
  Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
10954
10967
  Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
10955
10968
  Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
@@ -12230,7 +12243,8 @@ function isIdentifierStart(ch, languageVersion) {
12230
12243
  return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
12231
12244
  }
12232
12245
  function isIdentifierPart(ch, languageVersion, identifierVariant) {
12233
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
12246
+ return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || // "-" and ":" are valid in JSX Identifiers
12247
+ (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
12234
12248
  }
12235
12249
  function isIdentifierText(name, languageVersion, identifierVariant) {
12236
12250
  let ch = codePointAt(name, 0);
@@ -14015,6 +14029,10 @@ function unescapeLeadingUnderscores(identifier) {
14015
14029
  function idText(identifierOrPrivateName) {
14016
14030
  return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText);
14017
14031
  }
14032
+ function identifierToKeywordKind(node) {
14033
+ const token = stringToToken(node.escapedText);
14034
+ return token ? tryCast(token, isKeyword) : void 0;
14035
+ }
14018
14036
  function symbolName(symbol) {
14019
14037
  if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) {
14020
14038
  return idText(symbol.valueDeclaration.name);
@@ -14322,15 +14340,17 @@ function getJSDocReturnType(node) {
14322
14340
  }
14323
14341
  }
14324
14342
  function getJSDocTagsWorker(node, noCache) {
14343
+ var _a2, _b;
14325
14344
  if (!canHaveJSDoc(node))
14326
14345
  return emptyArray;
14327
- let tags = node.jsDocCache;
14346
+ let tags = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache;
14328
14347
  if (tags === void 0 || noCache) {
14329
14348
  const comments = getJSDocCommentsAndTags(node, noCache);
14330
14349
  Debug.assert(comments.length < 2 || comments[0] !== comments[1]);
14331
14350
  tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j);
14332
14351
  if (!noCache) {
14333
- node.jsDocCache = tags;
14352
+ (_b = node.jsDoc) != null ? _b : node.jsDoc = [];
14353
+ node.jsDoc.jsDocCache = tags;
14334
14354
  }
14335
14355
  }
14336
14356
  return tags;
@@ -14529,10 +14549,12 @@ function isStringTextContainingNode(node) {
14529
14549
  return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
14530
14550
  }
14531
14551
  function isGeneratedIdentifier(node) {
14532
- return isIdentifier(node) && node.autoGenerate !== void 0;
14552
+ var _a2;
14553
+ return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0;
14533
14554
  }
14534
14555
  function isGeneratedPrivateIdentifier(node) {
14535
- return isPrivateIdentifier(node) && node.autoGenerate !== void 0;
14556
+ var _a2;
14557
+ return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0;
14536
14558
  }
14537
14559
  function isPrivateIdentifierClassElementDeclaration(node) {
14538
14560
  return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name);
@@ -15914,10 +15936,11 @@ function isComputedNonLiteralName(name) {
15914
15936
  return name.kind === 164 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
15915
15937
  }
15916
15938
  function tryGetTextOfPropertyName(name) {
15939
+ var _a2;
15917
15940
  switch (name.kind) {
15918
15941
  case 79 /* Identifier */:
15919
15942
  case 80 /* PrivateIdentifier */:
15920
- return name.autoGenerate ? void 0 : name.escapedText;
15943
+ return ((_a2 = name.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name.escapedText;
15921
15944
  case 10 /* StringLiteral */:
15922
15945
  case 8 /* NumericLiteral */:
15923
15946
  case 14 /* NoSubstitutionTemplateLiteral */:
@@ -16035,6 +16058,20 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
16035
16058
  const start2 = scanner2.getTokenPos();
16036
16059
  return createTextSpanFromBounds(start2, scanner2.getTextPos());
16037
16060
  }
16061
+ function scanTokenAtPosition(sourceFile, pos) {
16062
+ const scanner2 = createScanner(
16063
+ sourceFile.languageVersion,
16064
+ /*skipTrivia*/
16065
+ true,
16066
+ sourceFile.languageVariant,
16067
+ sourceFile.text,
16068
+ /*onError:*/
16069
+ void 0,
16070
+ pos
16071
+ );
16072
+ scanner2.scan();
16073
+ return scanner2.getToken();
16074
+ }
16038
16075
  function getErrorSpanForArrowFunction(sourceFile, node) {
16039
16076
  const pos = skipTrivia(sourceFile.text, node.pos);
16040
16077
  if (node.body && node.body.kind === 238 /* Block */) {
@@ -17727,7 +17764,8 @@ function isStringAKeyword(name) {
17727
17764
  const token = stringToToken(name);
17728
17765
  return token !== void 0 && isKeyword(token);
17729
17766
  }
17730
- function isIdentifierANonContextualKeyword({ originalKeywordKind }) {
17767
+ function isIdentifierANonContextualKeyword(node) {
17768
+ const originalKeywordKind = identifierToKeywordKind(node);
17731
17769
  return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind);
17732
17770
  }
17733
17771
  function isTrivia(token) {
@@ -18599,7 +18637,7 @@ function isThisInTypeQuery(node) {
18599
18637
  return node.parent.kind === 183 /* TypeQuery */;
18600
18638
  }
18601
18639
  function identifierIsThisKeyword(id) {
18602
- return id.originalKeywordKind === 108 /* ThisKeyword */;
18640
+ return id.escapedText === "this";
18603
18641
  }
18604
18642
  function getAllAccessorDeclarations(declarations, accessor) {
18605
18643
  let firstAccessor;
@@ -18910,7 +18948,7 @@ function getEffectiveModifierFlagsNoCache(node) {
18910
18948
  }
18911
18949
  function getSyntacticModifierFlagsNoCache(node) {
18912
18950
  let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */;
18913
- if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.isInJSDocNamespace) {
18951
+ if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
18914
18952
  flags |= 1 /* Export */;
18915
18953
  }
18916
18954
  return flags;
@@ -19682,7 +19720,6 @@ function Identifier2(kind, pos, end) {
19682
19720
  this.parent = void 0;
19683
19721
  this.original = void 0;
19684
19722
  this.emitNode = void 0;
19685
- this.flowNode = void 0;
19686
19723
  }
19687
19724
  function SourceMapSource(fileName, text, skipTrivia2) {
19688
19725
  this.fileName = fileName;
@@ -19700,8 +19737,14 @@ var objectAllocator = {
19700
19737
  getSignatureConstructor: () => Signature2,
19701
19738
  getSourceMapSourceConstructor: () => SourceMapSource
19702
19739
  };
19740
+ var objectAllocatorPatchers = [];
19741
+ function addObjectAllocatorPatcher(fn) {
19742
+ objectAllocatorPatchers.push(fn);
19743
+ fn(objectAllocator);
19744
+ }
19703
19745
  function setObjectAllocator(alloc) {
19704
19746
  Object.assign(objectAllocator, alloc);
19747
+ forEach(objectAllocatorPatchers, (fn) => fn(objectAllocator));
19705
19748
  }
19706
19749
  function formatStringFromArgs(text, args, baseIndex = 0) {
19707
19750
  return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index + baseIndex]));
@@ -21723,7 +21766,6 @@ function createNodeFactory(flags, baseFactory2) {
21723
21766
  createRegularExpressionLiteral: createRegularExpressionLiteral2,
21724
21767
  createLiteralLikeNode,
21725
21768
  createIdentifier: createIdentifier3,
21726
- updateIdentifier,
21727
21769
  createTempVariable: createTempVariable3,
21728
21770
  createLoopVariable: createLoopVariable2,
21729
21771
  createUniqueName: createUniqueName2,
@@ -22466,55 +22508,43 @@ function createNodeFactory(flags, baseFactory2) {
22466
22508
  );
22467
22509
  }
22468
22510
  }
22469
- function createBaseIdentifier(escapedText, originalKeywordKind) {
22511
+ function createBaseIdentifier(escapedText) {
22470
22512
  const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
22471
- node.originalKeywordKind = originalKeywordKind;
22472
22513
  node.escapedText = escapedText;
22473
- node.autoGenerate = void 0;
22474
- node.typeArguments = void 0;
22475
- node.hasExtendedUnicodeEscape = void 0;
22476
22514
  node.jsDoc = void 0;
22477
- node.jsDocCache = void 0;
22478
22515
  node.flowNode = void 0;
22479
22516
  node.symbol = void 0;
22480
22517
  return node;
22481
22518
  }
22482
22519
  function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
22483
- const node = createBaseIdentifier(
22484
- escapeLeadingUnderscores(text),
22485
- /*originalKeywordKind*/
22486
- void 0
22487
- );
22488
- node.autoGenerate = {
22520
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text));
22521
+ setIdentifierAutoGenerate(node, {
22489
22522
  flags: autoGenerateFlags,
22490
22523
  id: nextAutoGenerateId,
22491
22524
  prefix,
22492
22525
  suffix
22493
- };
22526
+ });
22494
22527
  nextAutoGenerateId++;
22495
22528
  return node;
22496
22529
  }
22497
- function createIdentifier3(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
22530
+ function createIdentifier3(text, originalKeywordKind, hasExtendedUnicodeEscape) {
22498
22531
  if (originalKeywordKind === void 0 && text) {
22499
22532
  originalKeywordKind = stringToToken(text);
22500
22533
  }
22501
22534
  if (originalKeywordKind === 79 /* Identifier */) {
22502
22535
  originalKeywordKind = void 0;
22503
22536
  }
22504
- const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind);
22505
- node.typeArguments = asNodeArray(typeArguments);
22506
- node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
22507
- if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
22537
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text));
22538
+ if (hasExtendedUnicodeEscape)
22539
+ node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */;
22540
+ if (node.escapedText === "await") {
22508
22541
  node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
22509
22542
  }
22510
- if (node.hasExtendedUnicodeEscape) {
22543
+ if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) {
22511
22544
  node.transformFlags |= 1024 /* ContainsES2015 */;
22512
22545
  }
22513
22546
  return node;
22514
22547
  }
22515
- function updateIdentifier(node, typeArguments) {
22516
- return node.typeArguments !== typeArguments ? update(createIdentifier3(idText(node), typeArguments), node) : node;
22517
- }
22518
22548
  function createTempVariable3(recordTempVariable, reservedInNestedScopes, prefix, suffix) {
22519
22549
  let flags2 = 1 /* Auto */;
22520
22550
  if (reservedInNestedScopes)
@@ -22562,7 +22592,6 @@ function createNodeFactory(flags, baseFactory2) {
22562
22592
  function createBasePrivateIdentifier(escapedText) {
22563
22593
  const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
22564
22594
  node.escapedText = escapedText;
22565
- node.autoGenerate = void 0;
22566
22595
  node.transformFlags |= 16777216 /* ContainsClassFields */;
22567
22596
  return node;
22568
22597
  }
@@ -22573,12 +22602,12 @@ function createNodeFactory(flags, baseFactory2) {
22573
22602
  }
22574
22603
  function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
22575
22604
  const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
22576
- node.autoGenerate = {
22605
+ setIdentifierAutoGenerate(node, {
22577
22606
  flags: autoGenerateFlags,
22578
22607
  id: nextAutoGenerateId,
22579
22608
  prefix,
22580
22609
  suffix
22581
- };
22610
+ });
22582
22611
  nextAutoGenerateId++;
22583
22612
  return node;
22584
22613
  }
@@ -22740,7 +22769,6 @@ function createNodeFactory(flags, baseFactory2) {
22740
22769
  node.transformFlags = 1 /* ContainsTypeScript */;
22741
22770
  node.expression = void 0;
22742
22771
  node.jsDoc = void 0;
22743
- node.jsDocCache = void 0;
22744
22772
  return node;
22745
22773
  }
22746
22774
  function updateTypeParameterDeclaration2(node, modifiers, name, constraint, defaultType) {
@@ -22761,7 +22789,6 @@ function createNodeFactory(flags, baseFactory2) {
22761
22789
  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 */);
22762
22790
  }
22763
22791
  node.jsDoc = void 0;
22764
- node.jsDocCache = void 0;
22765
22792
  return node;
22766
22793
  }
22767
22794
  function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
@@ -22789,7 +22816,6 @@ function createNodeFactory(flags, baseFactory2) {
22789
22816
  node.transformFlags = 1 /* ContainsTypeScript */;
22790
22817
  node.initializer = void 0;
22791
22818
  node.jsDoc = void 0;
22792
- node.jsDocCache = void 0;
22793
22819
  return node;
22794
22820
  }
22795
22821
  function updatePropertySignature3(node, modifiers, name, questionToken, type) {
@@ -22812,7 +22838,6 @@ function createNodeFactory(flags, baseFactory2) {
22812
22838
  const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */;
22813
22839
  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 */;
22814
22840
  node.jsDoc = void 0;
22815
- node.jsDocCache = void 0;
22816
22841
  return node;
22817
22842
  }
22818
22843
  function updatePropertyDeclaration2(node, modifiers, name, questionOrExclamationToken, type, initializer) {
@@ -22828,7 +22853,6 @@ function createNodeFactory(flags, baseFactory2) {
22828
22853
  node.type = type;
22829
22854
  node.transformFlags = 1 /* ContainsTypeScript */;
22830
22855
  node.jsDoc = void 0;
22831
- node.jsDocCache = void 0;
22832
22856
  node.locals = void 0;
22833
22857
  node.nextContainer = void 0;
22834
22858
  node.typeArguments = void 0;
@@ -22858,7 +22882,6 @@ function createNodeFactory(flags, baseFactory2) {
22858
22882
  }
22859
22883
  node.typeArguments = void 0;
22860
22884
  node.jsDoc = void 0;
22861
- node.jsDocCache = void 0;
22862
22885
  node.locals = void 0;
22863
22886
  node.nextContainer = void 0;
22864
22887
  node.flowNode = void 0;
@@ -22882,7 +22905,6 @@ function createNodeFactory(flags, baseFactory2) {
22882
22905
  node.illegalDecorators = void 0;
22883
22906
  node.modifiers = void 0;
22884
22907
  node.jsDoc = void 0;
22885
- node.jsDocCache = void 0;
22886
22908
  node.locals = void 0;
22887
22909
  node.nextContainer = void 0;
22888
22910
  node.endFlowNode = void 0;
@@ -22910,7 +22932,6 @@ function createNodeFactory(flags, baseFactory2) {
22910
22932
  node.type = void 0;
22911
22933
  node.typeArguments = void 0;
22912
22934
  node.jsDoc = void 0;
22913
- node.jsDocCache = void 0;
22914
22935
  node.locals = void 0;
22915
22936
  node.nextContainer = void 0;
22916
22937
  node.endFlowNode = void 0;
@@ -22943,7 +22964,6 @@ function createNodeFactory(flags, baseFactory2) {
22943
22964
  node.typeArguments = void 0;
22944
22965
  node.typeParameters = void 0;
22945
22966
  node.jsDoc = void 0;
22946
- node.jsDocCache = void 0;
22947
22967
  node.locals = void 0;
22948
22968
  node.nextContainer = void 0;
22949
22969
  node.flowNode = void 0;
@@ -22975,7 +22995,6 @@ function createNodeFactory(flags, baseFactory2) {
22975
22995
  node.typeParameters = void 0;
22976
22996
  node.type = void 0;
22977
22997
  node.jsDoc = void 0;
22978
- node.jsDocCache = void 0;
22979
22998
  node.locals = void 0;
22980
22999
  node.nextContainer = void 0;
22981
23000
  node.flowNode = void 0;
@@ -23000,7 +23019,6 @@ function createNodeFactory(flags, baseFactory2) {
23000
23019
  node.type = type;
23001
23020
  node.transformFlags = 1 /* ContainsTypeScript */;
23002
23021
  node.jsDoc = void 0;
23003
- node.jsDocCache = void 0;
23004
23022
  node.locals = void 0;
23005
23023
  node.nextContainer = void 0;
23006
23024
  node.typeArguments = void 0;
@@ -23016,7 +23034,6 @@ function createNodeFactory(flags, baseFactory2) {
23016
23034
  node.type = type;
23017
23035
  node.transformFlags = 1 /* ContainsTypeScript */;
23018
23036
  node.jsDoc = void 0;
23019
- node.jsDocCache = void 0;
23020
23037
  node.locals = void 0;
23021
23038
  node.nextContainer = void 0;
23022
23039
  node.typeArguments = void 0;
@@ -23033,7 +23050,6 @@ function createNodeFactory(flags, baseFactory2) {
23033
23050
  node.transformFlags = 1 /* ContainsTypeScript */;
23034
23051
  node.illegalDecorators = void 0;
23035
23052
  node.jsDoc = void 0;
23036
- node.jsDocCache = void 0;
23037
23053
  node.locals = void 0;
23038
23054
  node.nextContainer = void 0;
23039
23055
  node.typeArguments = void 0;
@@ -23084,7 +23100,6 @@ function createNodeFactory(flags, baseFactory2) {
23084
23100
  node.transformFlags = 1 /* ContainsTypeScript */;
23085
23101
  node.modifiers = void 0;
23086
23102
  node.jsDoc = void 0;
23087
- node.jsDocCache = void 0;
23088
23103
  node.locals = void 0;
23089
23104
  node.nextContainer = void 0;
23090
23105
  node.typeArguments = void 0;
@@ -23110,7 +23125,6 @@ function createNodeFactory(flags, baseFactory2) {
23110
23125
  node.type = type;
23111
23126
  node.transformFlags = 1 /* ContainsTypeScript */;
23112
23127
  node.jsDoc = void 0;
23113
- node.jsDocCache = void 0;
23114
23128
  node.locals = void 0;
23115
23129
  node.nextContainer = void 0;
23116
23130
  node.typeArguments = void 0;
@@ -23179,7 +23193,6 @@ function createNodeFactory(flags, baseFactory2) {
23179
23193
  node.type = type;
23180
23194
  node.transformFlags = 1 /* ContainsTypeScript */;
23181
23195
  node.jsDoc = void 0;
23182
- node.jsDocCache = void 0;
23183
23196
  return node;
23184
23197
  }
23185
23198
  function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) {
@@ -23381,7 +23394,6 @@ function createNodeFactory(flags, baseFactory2) {
23381
23394
  node.multiLine = multiLine;
23382
23395
  node.transformFlags |= propagateChildrenFlags(node.properties);
23383
23396
  node.jsDoc = void 0;
23384
- node.jsDocCache = void 0;
23385
23397
  return node;
23386
23398
  }
23387
23399
  function updateObjectLiteralExpression(node, properties) {
@@ -23394,7 +23406,6 @@ function createNodeFactory(flags, baseFactory2) {
23394
23406
  node.name = name;
23395
23407
  node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
23396
23408
  node.jsDoc = void 0;
23397
- node.jsDocCache = void 0;
23398
23409
  node.flowNode = void 0;
23399
23410
  return node;
23400
23411
  }
@@ -23445,7 +23456,6 @@ function createNodeFactory(flags, baseFactory2) {
23445
23456
  node.argumentExpression = argumentExpression;
23446
23457
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression);
23447
23458
  node.jsDoc = void 0;
23448
- node.jsDocCache = void 0;
23449
23459
  node.flowNode = void 0;
23450
23460
  return node;
23451
23461
  }
@@ -23596,7 +23606,6 @@ function createNodeFactory(flags, baseFactory2) {
23596
23606
  node.expression = expression;
23597
23607
  node.transformFlags = propagateChildFlags(node.expression);
23598
23608
  node.jsDoc = void 0;
23599
- node.jsDocCache = void 0;
23600
23609
  return node;
23601
23610
  }
23602
23611
  function updateParenthesizedExpression(node, expression) {
@@ -23617,7 +23626,6 @@ function createNodeFactory(flags, baseFactory2) {
23617
23626
  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 */;
23618
23627
  node.typeArguments = void 0;
23619
23628
  node.jsDoc = void 0;
23620
- node.jsDocCache = void 0;
23621
23629
  node.locals = void 0;
23622
23630
  node.nextContainer = void 0;
23623
23631
  node.flowNode = void 0;
@@ -23640,7 +23648,6 @@ function createNodeFactory(flags, baseFactory2) {
23640
23648
  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 */;
23641
23649
  node.typeArguments = void 0;
23642
23650
  node.jsDoc = void 0;
23643
- node.jsDocCache = void 0;
23644
23651
  node.locals = void 0;
23645
23652
  node.nextContainer = void 0;
23646
23653
  node.flowNode = void 0;
@@ -23738,7 +23745,6 @@ function createNodeFactory(flags, baseFactory2) {
23738
23745
  node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */;
23739
23746
  }
23740
23747
  node.jsDoc = void 0;
23741
- node.jsDocCache = void 0;
23742
23748
  return node;
23743
23749
  }
23744
23750
  function propagateAssignmentPatternFlags(node) {
@@ -23880,7 +23886,6 @@ function createNodeFactory(flags, baseFactory2) {
23880
23886
  node.members = createNodeArray2(members);
23881
23887
  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 */;
23882
23888
  node.jsDoc = void 0;
23883
- node.jsDocCache = void 0;
23884
23889
  return node;
23885
23890
  }
23886
23891
  function updateClassExpression3(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -23996,7 +24001,6 @@ function createNodeFactory(flags, baseFactory2) {
23996
24001
  node.multiLine = multiLine;
23997
24002
  node.transformFlags |= propagateChildrenFlags(node.statements);
23998
24003
  node.jsDoc = void 0;
23999
- node.jsDocCache = void 0;
24000
24004
  node.locals = void 0;
24001
24005
  node.nextContainer = void 0;
24002
24006
  return node;
@@ -24014,7 +24018,6 @@ function createNodeFactory(flags, baseFactory2) {
24014
24018
  }
24015
24019
  node.illegalDecorators = void 0;
24016
24020
  node.jsDoc = void 0;
24017
- node.jsDocCache = void 0;
24018
24021
  node.flowNode = void 0;
24019
24022
  return node;
24020
24023
  }
@@ -24024,7 +24027,6 @@ function createNodeFactory(flags, baseFactory2) {
24024
24027
  function createEmptyStatement2() {
24025
24028
  const node = createBaseNode(239 /* EmptyStatement */);
24026
24029
  node.jsDoc = void 0;
24027
- node.jsDocCache = void 0;
24028
24030
  return node;
24029
24031
  }
24030
24032
  function createExpressionStatement2(expression) {
@@ -24032,7 +24034,6 @@ function createNodeFactory(flags, baseFactory2) {
24032
24034
  node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
24033
24035
  node.transformFlags |= propagateChildFlags(node.expression);
24034
24036
  node.jsDoc = void 0;
24035
- node.jsDocCache = void 0;
24036
24037
  node.flowNode = void 0;
24037
24038
  return node;
24038
24039
  }
@@ -24046,7 +24047,6 @@ function createNodeFactory(flags, baseFactory2) {
24046
24047
  node.elseStatement = asEmbeddedStatement(elseStatement);
24047
24048
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement);
24048
24049
  node.jsDoc = void 0;
24049
- node.jsDocCache = void 0;
24050
24050
  node.flowNode = void 0;
24051
24051
  return node;
24052
24052
  }
@@ -24059,7 +24059,6 @@ function createNodeFactory(flags, baseFactory2) {
24059
24059
  node.expression = expression;
24060
24060
  node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
24061
24061
  node.jsDoc = void 0;
24062
- node.jsDocCache = void 0;
24063
24062
  node.flowNode = void 0;
24064
24063
  return node;
24065
24064
  }
@@ -24072,7 +24071,6 @@ function createNodeFactory(flags, baseFactory2) {
24072
24071
  node.statement = asEmbeddedStatement(statement);
24073
24072
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
24074
24073
  node.jsDoc = void 0;
24075
- node.jsDocCache = void 0;
24076
24074
  node.flowNode = void 0;
24077
24075
  return node;
24078
24076
  }
@@ -24087,7 +24085,6 @@ function createNodeFactory(flags, baseFactory2) {
24087
24085
  node.statement = asEmbeddedStatement(statement);
24088
24086
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement);
24089
24087
  node.jsDoc = void 0;
24090
- node.jsDocCache = void 0;
24091
24088
  node.locals = void 0;
24092
24089
  node.nextContainer = void 0;
24093
24090
  node.flowNode = void 0;
@@ -24103,7 +24100,6 @@ function createNodeFactory(flags, baseFactory2) {
24103
24100
  node.statement = asEmbeddedStatement(statement);
24104
24101
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
24105
24102
  node.jsDoc = void 0;
24106
- node.jsDocCache = void 0;
24107
24103
  node.locals = void 0;
24108
24104
  node.nextContainer = void 0;
24109
24105
  node.flowNode = void 0;
@@ -24122,7 +24118,6 @@ function createNodeFactory(flags, baseFactory2) {
24122
24118
  if (awaitModifier)
24123
24119
  node.transformFlags |= 128 /* ContainsES2018 */;
24124
24120
  node.jsDoc = void 0;
24125
- node.jsDocCache = void 0;
24126
24121
  node.locals = void 0;
24127
24122
  node.nextContainer = void 0;
24128
24123
  node.flowNode = void 0;
@@ -24136,7 +24131,6 @@ function createNodeFactory(flags, baseFactory2) {
24136
24131
  node.label = asName(label);
24137
24132
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
24138
24133
  node.jsDoc = void 0;
24139
- node.jsDocCache = void 0;
24140
24134
  node.flowNode = void 0;
24141
24135
  return node;
24142
24136
  }
@@ -24148,7 +24142,6 @@ function createNodeFactory(flags, baseFactory2) {
24148
24142
  node.label = asName(label);
24149
24143
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
24150
24144
  node.jsDoc = void 0;
24151
- node.jsDocCache = void 0;
24152
24145
  node.flowNode = void 0;
24153
24146
  return node;
24154
24147
  }
@@ -24160,7 +24153,6 @@ function createNodeFactory(flags, baseFactory2) {
24160
24153
  node.expression = expression;
24161
24154
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
24162
24155
  node.jsDoc = void 0;
24163
- node.jsDocCache = void 0;
24164
24156
  node.flowNode = void 0;
24165
24157
  return node;
24166
24158
  }
@@ -24173,7 +24165,6 @@ function createNodeFactory(flags, baseFactory2) {
24173
24165
  node.statement = asEmbeddedStatement(statement);
24174
24166
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
24175
24167
  node.jsDoc = void 0;
24176
- node.jsDocCache = void 0;
24177
24168
  node.flowNode = void 0;
24178
24169
  return node;
24179
24170
  }
@@ -24186,7 +24177,6 @@ function createNodeFactory(flags, baseFactory2) {
24186
24177
  node.caseBlock = caseBlock;
24187
24178
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
24188
24179
  node.jsDoc = void 0;
24189
- node.jsDocCache = void 0;
24190
24180
  node.flowNode = void 0;
24191
24181
  node.possiblyExhaustive = false;
24192
24182
  return node;
@@ -24200,7 +24190,6 @@ function createNodeFactory(flags, baseFactory2) {
24200
24190
  node.statement = asEmbeddedStatement(statement);
24201
24191
  node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
24202
24192
  node.jsDoc = void 0;
24203
- node.jsDocCache = void 0;
24204
24193
  node.flowNode = void 0;
24205
24194
  return node;
24206
24195
  }
@@ -24212,7 +24201,6 @@ function createNodeFactory(flags, baseFactory2) {
24212
24201
  node.expression = expression;
24213
24202
  node.transformFlags |= propagateChildFlags(node.expression);
24214
24203
  node.jsDoc = void 0;
24215
- node.jsDocCache = void 0;
24216
24204
  node.flowNode = void 0;
24217
24205
  return node;
24218
24206
  }
@@ -24226,7 +24214,6 @@ function createNodeFactory(flags, baseFactory2) {
24226
24214
  node.finallyBlock = finallyBlock;
24227
24215
  node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock);
24228
24216
  node.jsDoc = void 0;
24229
- node.jsDocCache = void 0;
24230
24217
  node.flowNode = void 0;
24231
24218
  return node;
24232
24219
  }
@@ -24236,7 +24223,6 @@ function createNodeFactory(flags, baseFactory2) {
24236
24223
  function createDebuggerStatement2() {
24237
24224
  const node = createBaseNode(256 /* DebuggerStatement */);
24238
24225
  node.jsDoc = void 0;
24239
- node.jsDocCache = void 0;
24240
24226
  node.flowNode = void 0;
24241
24227
  return node;
24242
24228
  }
@@ -24249,7 +24235,6 @@ function createNodeFactory(flags, baseFactory2) {
24249
24235
  node.initializer = asInitializer(initializer);
24250
24236
  node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */);
24251
24237
  node.jsDoc = void 0;
24252
- node.jsDocCache = void 0;
24253
24238
  return node;
24254
24239
  }
24255
24240
  function updateVariableDeclaration3(node, name, exclamationToken, type, initializer) {
@@ -24288,7 +24273,6 @@ function createNodeFactory(flags, baseFactory2) {
24288
24273
  node.illegalDecorators = void 0;
24289
24274
  node.typeArguments = void 0;
24290
24275
  node.jsDoc = void 0;
24291
- node.jsDocCache = void 0;
24292
24276
  node.locals = void 0;
24293
24277
  node.nextContainer = void 0;
24294
24278
  node.endFlowNode = void 0;
@@ -24320,7 +24304,6 @@ function createNodeFactory(flags, baseFactory2) {
24320
24304
  }
24321
24305
  }
24322
24306
  node.jsDoc = void 0;
24323
- node.jsDocCache = void 0;
24324
24307
  return node;
24325
24308
  }
24326
24309
  function updateClassDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -24336,7 +24319,6 @@ function createNodeFactory(flags, baseFactory2) {
24336
24319
  node.transformFlags = 1 /* ContainsTypeScript */;
24337
24320
  node.illegalDecorators = void 0;
24338
24321
  node.jsDoc = void 0;
24339
- node.jsDocCache = void 0;
24340
24322
  return node;
24341
24323
  }
24342
24324
  function updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -24357,7 +24339,6 @@ function createNodeFactory(flags, baseFactory2) {
24357
24339
  node.transformFlags = 1 /* ContainsTypeScript */;
24358
24340
  node.illegalDecorators = void 0;
24359
24341
  node.jsDoc = void 0;
24360
- node.jsDocCache = void 0;
24361
24342
  node.locals = void 0;
24362
24343
  node.nextContainer = void 0;
24363
24344
  return node;
@@ -24380,7 +24361,6 @@ function createNodeFactory(flags, baseFactory2) {
24380
24361
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
24381
24362
  node.illegalDecorators = void 0;
24382
24363
  node.jsDoc = void 0;
24383
- node.jsDocCache = void 0;
24384
24364
  return node;
24385
24365
  }
24386
24366
  function updateEnumDeclaration2(node, modifiers, name, members) {
@@ -24406,7 +24386,6 @@ function createNodeFactory(flags, baseFactory2) {
24406
24386
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
24407
24387
  node.illegalDecorators = void 0;
24408
24388
  node.jsDoc = void 0;
24409
- node.jsDocCache = void 0;
24410
24389
  node.locals = void 0;
24411
24390
  node.nextContainer = void 0;
24412
24391
  return node;
@@ -24425,7 +24404,6 @@ function createNodeFactory(flags, baseFactory2) {
24425
24404
  node.statements = createNodeArray2(statements);
24426
24405
  node.transformFlags |= propagateChildrenFlags(node.statements);
24427
24406
  node.jsDoc = void 0;
24428
- node.jsDocCache = void 0;
24429
24407
  return node;
24430
24408
  }
24431
24409
  function updateModuleBlock2(node, statements) {
@@ -24449,7 +24427,6 @@ function createNodeFactory(flags, baseFactory2) {
24449
24427
  node.illegalDecorators = void 0;
24450
24428
  node.modifiers = void 0;
24451
24429
  node.jsDoc = void 0;
24452
- node.jsDocCache = void 0;
24453
24430
  return node;
24454
24431
  }
24455
24432
  function updateNamespaceExportDeclaration2(node, name) {
@@ -24475,7 +24452,6 @@ function createNodeFactory(flags, baseFactory2) {
24475
24452
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
24476
24453
  node.illegalDecorators = void 0;
24477
24454
  node.jsDoc = void 0;
24478
- node.jsDocCache = void 0;
24479
24455
  return node;
24480
24456
  }
24481
24457
  function updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference) {
@@ -24497,7 +24473,6 @@ function createNodeFactory(flags, baseFactory2) {
24497
24473
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
24498
24474
  node.illegalDecorators = void 0;
24499
24475
  node.jsDoc = void 0;
24500
- node.jsDocCache = void 0;
24501
24476
  return node;
24502
24477
  }
24503
24478
  function updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause) {
@@ -24609,7 +24584,6 @@ function createNodeFactory(flags, baseFactory2) {
24609
24584
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
24610
24585
  node.illegalDecorators = void 0;
24611
24586
  node.jsDoc = void 0;
24612
- node.jsDocCache = void 0;
24613
24587
  return node;
24614
24588
  }
24615
24589
  function updateExportAssignment2(node, modifiers, expression) {
@@ -24632,7 +24606,6 @@ function createNodeFactory(flags, baseFactory2) {
24632
24606
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
24633
24607
  node.illegalDecorators = void 0;
24634
24608
  node.jsDoc = void 0;
24635
- node.jsDocCache = void 0;
24636
24609
  return node;
24637
24610
  }
24638
24611
  function updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
@@ -24662,7 +24635,6 @@ function createNodeFactory(flags, baseFactory2) {
24662
24635
  node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name);
24663
24636
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
24664
24637
  node.jsDoc = void 0;
24665
- node.jsDocCache = void 0;
24666
24638
  return node;
24667
24639
  }
24668
24640
  function updateExportSpecifier2(node, isTypeOnly, propertyName, name) {
@@ -24671,7 +24643,6 @@ function createNodeFactory(flags, baseFactory2) {
24671
24643
  function createMissingDeclaration() {
24672
24644
  const node = createBaseDeclaration(279 /* MissingDeclaration */);
24673
24645
  node.jsDoc = void 0;
24674
- node.jsDocCache = void 0;
24675
24646
  return node;
24676
24647
  }
24677
24648
  function createExternalModuleReference2(expression) {
@@ -24712,7 +24683,6 @@ function createNodeFactory(flags, baseFactory2) {
24712
24683
  node.type = type;
24713
24684
  node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
24714
24685
  node.jsDoc = void 0;
24715
- node.jsDocCache = void 0;
24716
24686
  node.locals = void 0;
24717
24687
  node.nextContainer = void 0;
24718
24688
  node.typeArguments = void 0;
@@ -24744,7 +24714,6 @@ function createNodeFactory(flags, baseFactory2) {
24744
24714
  node.parameters = createNodeArray2(parameters);
24745
24715
  node.type = type;
24746
24716
  node.jsDoc = void 0;
24747
- node.jsDocCache = void 0;
24748
24717
  node.locals = void 0;
24749
24718
  node.nextContainer = void 0;
24750
24719
  return node;
@@ -25072,7 +25041,6 @@ function createNodeFactory(flags, baseFactory2) {
25072
25041
  node.statements = createNodeArray2(statements);
25073
25042
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
25074
25043
  node.jsDoc = void 0;
25075
- node.jsDocCache = void 0;
25076
25044
  return node;
25077
25045
  }
25078
25046
  function updateCaseClause2(node, expression, statements) {
@@ -25129,7 +25097,6 @@ function createNodeFactory(flags, baseFactory2) {
25129
25097
  node.questionToken = void 0;
25130
25098
  node.exclamationToken = void 0;
25131
25099
  node.jsDoc = void 0;
25132
- node.jsDocCache = void 0;
25133
25100
  return node;
25134
25101
  }
25135
25102
  function updatePropertyAssignment2(node, name, initializer) {
@@ -25155,7 +25122,6 @@ function createNodeFactory(flags, baseFactory2) {
25155
25122
  node.questionToken = void 0;
25156
25123
  node.exclamationToken = void 0;
25157
25124
  node.jsDoc = void 0;
25158
- node.jsDocCache = void 0;
25159
25125
  return node;
25160
25126
  }
25161
25127
  function updateShorthandPropertyAssignment2(node, name, objectAssignmentInitializer) {
@@ -25176,7 +25142,6 @@ function createNodeFactory(flags, baseFactory2) {
25176
25142
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
25177
25143
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
25178
25144
  node.jsDoc = void 0;
25179
- node.jsDocCache = void 0;
25180
25145
  return node;
25181
25146
  }
25182
25147
  function updateSpreadAssignment2(node, expression) {
@@ -25188,7 +25153,6 @@ function createNodeFactory(flags, baseFactory2) {
25188
25153
  node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
25189
25154
  node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
25190
25155
  node.jsDoc = void 0;
25191
- node.jsDocCache = void 0;
25192
25156
  return node;
25193
25157
  }
25194
25158
  function updateEnumMember2(node, name, initializer) {
@@ -25434,36 +25398,32 @@ function createNodeFactory(flags, baseFactory2) {
25434
25398
  return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node;
25435
25399
  }
25436
25400
  function cloneGeneratedIdentifier(node) {
25437
- const clone2 = createBaseIdentifier(
25438
- node.escapedText,
25439
- /*originalKeywordKind*/
25440
- void 0
25441
- );
25401
+ const clone2 = createBaseIdentifier(node.escapedText);
25442
25402
  clone2.flags |= node.flags & ~8 /* Synthesized */;
25443
- clone2.autoGenerate = { ...node.autoGenerate };
25444
25403
  clone2.transformFlags = node.transformFlags;
25445
25404
  setOriginalNode(clone2, node);
25405
+ setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
25446
25406
  return clone2;
25447
25407
  }
25448
25408
  function cloneIdentifier(node) {
25449
- const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind);
25409
+ const clone2 = createBaseIdentifier(node.escapedText);
25450
25410
  clone2.flags |= node.flags & ~8 /* Synthesized */;
25451
- clone2.typeArguments = node.typeArguments;
25452
- clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape;
25453
25411
  clone2.jsDoc = node.jsDoc;
25454
- clone2.jsDocCache = node.jsDocCache;
25455
25412
  clone2.flowNode = node.flowNode;
25456
25413
  clone2.symbol = node.symbol;
25457
25414
  clone2.transformFlags = node.transformFlags;
25458
25415
  setOriginalNode(clone2, node);
25416
+ const typeArguments = getIdentifierTypeArguments(node);
25417
+ if (typeArguments)
25418
+ setIdentifierTypeArguments(clone2, typeArguments);
25459
25419
  return clone2;
25460
25420
  }
25461
25421
  function cloneGeneratedPrivateIdentifier(node) {
25462
25422
  const clone2 = createBasePrivateIdentifier(node.escapedText);
25463
25423
  clone2.flags |= node.flags & ~8 /* Synthesized */;
25464
- clone2.autoGenerate = { ...node.autoGenerate };
25465
25424
  clone2.transformFlags = node.transformFlags;
25466
25425
  setOriginalNode(clone2, node);
25426
+ setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
25467
25427
  return clone2;
25468
25428
  }
25469
25429
  function clonePrivateIdentifier(node) {
@@ -26717,6 +26677,30 @@ function getTypeNode(node) {
26717
26677
  var _a2;
26718
26678
  return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode;
26719
26679
  }
26680
+ function setIdentifierTypeArguments(node, typeArguments) {
26681
+ getOrCreateEmitNode(node).identifierTypeArguments = typeArguments;
26682
+ return node;
26683
+ }
26684
+ function getIdentifierTypeArguments(node) {
26685
+ var _a2;
26686
+ return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments;
26687
+ }
26688
+ function setIdentifierAutoGenerate(node, autoGenerate) {
26689
+ getOrCreateEmitNode(node).autoGenerate = autoGenerate;
26690
+ return node;
26691
+ }
26692
+ function getIdentifierAutoGenerate(node) {
26693
+ var _a2;
26694
+ return (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate;
26695
+ }
26696
+ function setIdentifierGeneratedImportReference(node, value) {
26697
+ getOrCreateEmitNode(node).generatedImportReference = value;
26698
+ return node;
26699
+ }
26700
+ function getIdentifierGeneratedImportReference(node) {
26701
+ var _a2;
26702
+ return (_a2 = node.emitNode) == null ? void 0 : _a2.generatedImportReference;
26703
+ }
26720
26704
 
26721
26705
  // src/compiler/factory/emitHelpers.ts
26722
26706
  function createEmitHelperFactory(context) {
@@ -29064,13 +29048,16 @@ function elideNodes(factory2, nodes) {
29064
29048
  return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes);
29065
29049
  }
29066
29050
  function getNodeForGeneratedName(name) {
29067
- if (name.autoGenerate.flags & 4 /* Node */) {
29068
- const autoGenerateId = name.autoGenerate.id;
29051
+ var _a2;
29052
+ const autoGenerate = name.emitNode.autoGenerate;
29053
+ if (autoGenerate.flags & 4 /* Node */) {
29054
+ const autoGenerateId = autoGenerate.id;
29069
29055
  let node = name;
29070
29056
  let original = node.original;
29071
29057
  while (original) {
29072
29058
  node = original;
29073
- if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) {
29059
+ const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate;
29060
+ if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) {
29074
29061
  break;
29075
29062
  }
29076
29063
  original = node.original;
@@ -30684,8 +30671,6 @@ var Parser;
30684
30671
  const pos = getNodePos();
30685
30672
  const result = kind === 79 /* Identifier */ ? factory2.createIdentifier(
30686
30673
  "",
30687
- /*typeArguments*/
30688
- void 0,
30689
30674
  /*originalKeywordKind*/
30690
30675
  void 0
30691
30676
  ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(
@@ -30720,13 +30705,7 @@ var Parser;
30720
30705
  const text = internIdentifier(scanner2.getTokenValue());
30721
30706
  const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape();
30722
30707
  nextTokenWithoutCheck();
30723
- return finishNode(factory2.createIdentifier(
30724
- text,
30725
- /*typeArguments*/
30726
- void 0,
30727
- originalKeywordKind,
30728
- hasExtendedUnicodeEscape
30729
- ), pos);
30708
+ return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos);
30730
30709
  }
30731
30710
  if (token() === 80 /* PrivateIdentifier */) {
30732
30711
  parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
@@ -31068,6 +31047,7 @@ var Parser;
31068
31047
  return parseElement();
31069
31048
  }
31070
31049
  function currentNode(parsingContext2, pos) {
31050
+ var _a2;
31071
31051
  if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) {
31072
31052
  return void 0;
31073
31053
  }
@@ -31082,8 +31062,8 @@ var Parser;
31082
31062
  if (!canReuseNode(node, parsingContext2)) {
31083
31063
  return void 0;
31084
31064
  }
31085
- if (canHaveJSDoc(node) && node.jsDocCache) {
31086
- node.jsDocCache = void 0;
31065
+ if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) {
31066
+ node.jsDoc.jsDocCache = void 0;
31087
31067
  }
31088
31068
  return node;
31089
31069
  }
@@ -31142,7 +31122,7 @@ var Parser;
31142
31122
  return true;
31143
31123
  case 171 /* MethodDeclaration */:
31144
31124
  const methodDeclaration = node;
31145
- const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 135 /* ConstructorKeyword */;
31125
+ const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.escapedText === "constructor";
31146
31126
  return !nameIsConstructor;
31147
31127
  }
31148
31128
  }
@@ -31364,13 +31344,10 @@ var Parser;
31364
31344
  function parseEntityName(allowReservedWords, diagnosticMessage) {
31365
31345
  const pos = getNodePos();
31366
31346
  let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
31367
- let dotPos = getNodePos();
31368
31347
  while (parseOptional(24 /* DotToken */)) {
31369
31348
  if (token() === 29 /* LessThanToken */) {
31370
- entity.jsdocDotPos = dotPos;
31371
31349
  break;
31372
31350
  }
31373
- dotPos = getNodePos();
31374
31351
  entity = finishNode(
31375
31352
  factory2.createQualifiedName(
31376
31353
  entity,
@@ -36150,7 +36127,7 @@ var Parser;
36150
36127
  return finishNode(jsDocNamespaceNode, pos);
36151
36128
  }
36152
36129
  if (nested) {
36153
- typeNameOrNamespaceName.isInJSDocNamespace = true;
36130
+ typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */;
36154
36131
  }
36155
36132
  return typeNameOrNamespaceName;
36156
36133
  }
@@ -36354,12 +36331,7 @@ var Parser;
36354
36331
  const end2 = scanner2.getTextPos();
36355
36332
  const originalKeywordKind = token();
36356
36333
  const text = internIdentifier(scanner2.getTokenValue());
36357
- const result = finishNode(factory2.createIdentifier(
36358
- text,
36359
- /*typeArguments*/
36360
- void 0,
36361
- originalKeywordKind
36362
- ), pos, end2);
36334
+ const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2);
36363
36335
  nextTokenJSDoc();
36364
36336
  return result;
36365
36337
  }
@@ -38963,7 +38935,8 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
38963
38935
  if (returnValue) {
38964
38936
  result[keyText] = value;
38965
38937
  }
38966
- if (jsonConversionNotifier && (parentOption || isRootOptionMap(knownOptions))) {
38938
+ if (jsonConversionNotifier && // Current callbacks are only on known parent option or if we are setting values in the root
38939
+ (parentOption || isRootOptionMap(knownOptions))) {
38967
38940
  const isValidOptionValue = isCompilerOptionsValue(option, value);
38968
38941
  if (parentOption) {
38969
38942
  if (isValidOptionValue) {
@@ -40286,7 +40259,7 @@ function resolvedTypeScriptOnly(resolved) {
40286
40259
  Debug.assert(extensionIsTS(resolved.extension));
40287
40260
  return { fileName: resolved.path, packageId: resolved.packageId };
40288
40261
  }
40289
- function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) {
40262
+ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
40290
40263
  if (resultFromCache) {
40291
40264
  resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
40292
40265
  resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations);
@@ -40304,7 +40277,8 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra
40304
40277
  },
40305
40278
  failedLookupLocations: initializeResolutionField(failedLookupLocations),
40306
40279
  affectingLocations: initializeResolutionField(affectingLocations),
40307
- resolutionDiagnostics: initializeResolutionField(diagnostics)
40280
+ resolutionDiagnostics: initializeResolutionField(diagnostics),
40281
+ node10Result: legacyResult
40308
40282
  };
40309
40283
  }
40310
40284
  function initializeResolutionField(value) {
@@ -41359,7 +41333,7 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
41359
41333
  );
41360
41334
  }
41361
41335
  function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
41362
- var _a2, _b;
41336
+ var _a2, _b, _c, _d;
41363
41337
  const traceEnabled = isTraceEnabled(compilerOptions, host);
41364
41338
  const failedLookupLocations = [];
41365
41339
  const affectingLocations = [];
@@ -41386,44 +41360,60 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
41386
41360
  if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) {
41387
41361
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
41388
41362
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
41389
- result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
41363
+ result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
41390
41364
  } else {
41391
- result = tryResolve(extensions);
41365
+ result = tryResolve(extensions, state);
41366
+ }
41367
+ let legacyResult;
41368
+ if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) {
41369
+ traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
41370
+ const diagnosticState = {
41371
+ ...state,
41372
+ features: state.features & ~8 /* Exports */,
41373
+ failedLookupLocations: [],
41374
+ affectingLocations: [],
41375
+ reportDiagnostic: noop
41376
+ };
41377
+ const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
41378
+ if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
41379
+ legacyResult = diagnosticResult.value.resolved.path;
41380
+ }
41392
41381
  }
41393
41382
  return createResolvedModuleWithFailedLookupLocations(
41394
- (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved,
41395
- (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport,
41383
+ (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
41384
+ (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
41396
41385
  failedLookupLocations,
41397
41386
  affectingLocations,
41398
41387
  diagnostics,
41399
- state.resultFromCache
41388
+ state.resultFromCache,
41389
+ legacyResult
41400
41390
  );
41401
- function tryResolve(extensions2) {
41402
- const loader = (extensions3, candidate, onlyRecordFailures, state2) => nodeLoadModuleByRelativeName(
41391
+ function tryResolve(extensions2, state2) {
41392
+ const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName(
41403
41393
  extensions3,
41404
41394
  candidate,
41405
41395
  onlyRecordFailures,
41406
- state2,
41396
+ state3,
41407
41397
  /*considerPackageJson*/
41408
41398
  true
41409
41399
  );
41410
- const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state);
41400
+ const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2);
41411
41401
  if (resolved) {
41412
41402
  return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
41413
41403
  }
41414
41404
  if (!isExternalModuleNameRelative(moduleName)) {
41415
41405
  let resolved2;
41416
41406
  if (features & 2 /* Imports */ && startsWith(moduleName, "#")) {
41417
- resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
41407
+ resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
41418
41408
  }
41419
41409
  if (!resolved2 && features & 4 /* SelfName */) {
41420
- resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
41410
+ resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
41421
41411
  }
41422
41412
  if (!resolved2) {
41423
41413
  if (traceEnabled) {
41424
41414
  trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
41425
41415
  }
41426
- resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
41416
+ resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
41427
41417
  }
41428
41418
  if (!resolved2)
41429
41419
  return void 0;
@@ -41442,7 +41432,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
41442
41432
  candidate,
41443
41433
  /*onlyRecordFailures*/
41444
41434
  false,
41445
- state,
41435
+ state2,
41446
41436
  /*considerPackageJson*/
41447
41437
  true
41448
41438
  );
@@ -42782,7 +42772,7 @@ function getModuleInstanceStateWorker(node, visited) {
42782
42772
  case 264 /* ModuleDeclaration */:
42783
42773
  return getModuleInstanceState(node, visited);
42784
42774
  case 79 /* Identifier */:
42785
- if (node.isInJSDocNamespace) {
42775
+ if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
42786
42776
  return 0 /* NonInstantiated */;
42787
42777
  }
42788
42778
  }
@@ -43219,6 +43209,7 @@ function createBinder() {
43219
43209
  } else if (containerFlags & 64 /* IsInterface */) {
43220
43210
  seenThisKeyword = false;
43221
43211
  bindChildren(node);
43212
+ Debug.assertNotNode(node, isIdentifier);
43222
43213
  node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */;
43223
43214
  } else {
43224
43215
  bindChildren(node);
@@ -44378,13 +44369,14 @@ function createBinder() {
44378
44369
  }
44379
44370
  function checkContextualIdentifier(node) {
44380
44371
  if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) {
44381
- if (inStrictMode && node.originalKeywordKind >= 117 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 125 /* LastFutureReservedWord */) {
44372
+ const originalKeywordKind = identifierToKeywordKind(node);
44373
+ if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) {
44382
44374
  file.bindDiagnostics.push(createDiagnosticForNode2(
44383
44375
  node,
44384
44376
  getStrictModeIdentifierMessage(node),
44385
44377
  declarationNameToString(node)
44386
44378
  ));
44387
- } else if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
44379
+ } else if (originalKeywordKind === 133 /* AwaitKeyword */) {
44388
44380
  if (isExternalModule(file) && isInTopLevelContext(node)) {
44389
44381
  file.bindDiagnostics.push(createDiagnosticForNode2(
44390
44382
  node,
@@ -44398,7 +44390,7 @@ function createBinder() {
44398
44390
  declarationNameToString(node)
44399
44391
  ));
44400
44392
  }
44401
- } else if (node.originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {
44393
+ } else if (originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {
44402
44394
  file.bindDiagnostics.push(createDiagnosticForNode2(
44403
44395
  node,
44404
44396
  Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,
@@ -44610,7 +44602,7 @@ function createBinder() {
44610
44602
  function bindWorker(node) {
44611
44603
  switch (node.kind) {
44612
44604
  case 79 /* Identifier */:
44613
- if (node.isInJSDocNamespace) {
44605
+ if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
44614
44606
  let parentNode = node.parent;
44615
44607
  while (parentNode && !isJSDocTypeAlias(parentNode)) {
44616
44608
  parentNode = parentNode.parent;
@@ -45434,8 +45426,12 @@ function createBinder() {
45434
45426
  return false;
45435
45427
  }
45436
45428
  if (currentFlow === unreachableFlow) {
45437
- const reportError = isStatementButNotDeclaration(node) && node.kind !== 239 /* EmptyStatement */ || // report error on class declarations
45438
- node.kind === 260 /* ClassDeclaration */ || node.kind === 264 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
45429
+ const reportError = (
45430
+ // report error on all statements except empty ones
45431
+ isStatementButNotDeclaration(node) && node.kind !== 239 /* EmptyStatement */ || // report error on class declarations
45432
+ node.kind === 260 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set
45433
+ node.kind === 264 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)
45434
+ );
45439
45435
  if (reportError) {
45440
45436
  currentFlow = reportedUnreachableFlow;
45441
45437
  if (!options.allowUnreachableCode) {
@@ -49668,6 +49664,8 @@ function createTypeChecker(host) {
49668
49664
  /*isError*/
49669
49665
  false,
49670
49666
  errorNode,
49667
+ currentSourceFile,
49668
+ mode,
49671
49669
  resolvedModule,
49672
49670
  moduleReference
49673
49671
  );
@@ -49753,6 +49751,8 @@ function createTypeChecker(host) {
49753
49751
  /*isError*/
49754
49752
  noImplicitAny && !!moduleNotFoundError,
49755
49753
  errorNode,
49754
+ currentSourceFile,
49755
+ mode,
49756
49756
  resolvedModule,
49757
49757
  moduleReference
49758
49758
  );
@@ -49807,26 +49807,37 @@ function createTypeChecker(host) {
49807
49807
  return importSourceWithoutExtension;
49808
49808
  }
49809
49809
  }
49810
- function errorOnImplicitAnyModule(isError, errorNode, { packageId, resolvedFileName }, moduleReference) {
49811
- const errorInfo = !isExternalModuleNameRelative(moduleReference) && packageId ? typesPackageExists(packageId.name) ? chainDiagnosticMessages(
49812
- /*details*/
49813
- void 0,
49814
- Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,
49815
- packageId.name,
49816
- mangleScopedPackageName(packageId.name)
49817
- ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages(
49818
- /*details*/
49819
- void 0,
49820
- Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,
49821
- packageId.name,
49822
- moduleReference
49823
- ) : chainDiagnosticMessages(
49824
- /*details*/
49825
- void 0,
49826
- Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
49827
- moduleReference,
49828
- mangleScopedPackageName(packageId.name)
49829
- ) : void 0;
49810
+ function errorOnImplicitAnyModule(isError, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) {
49811
+ var _a2, _b;
49812
+ let errorInfo;
49813
+ if (!isExternalModuleNameRelative(moduleReference) && packageId) {
49814
+ const node10Result = (_b = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleReference, mode)) == null ? void 0 : _b.node10Result;
49815
+ errorInfo = node10Result ? chainDiagnosticMessages(
49816
+ /*details*/
49817
+ void 0,
49818
+ Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
49819
+ node10Result,
49820
+ node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageId.name)}` : packageId.name
49821
+ ) : typesPackageExists(packageId.name) ? chainDiagnosticMessages(
49822
+ /*details*/
49823
+ void 0,
49824
+ Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,
49825
+ packageId.name,
49826
+ mangleScopedPackageName(packageId.name)
49827
+ ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages(
49828
+ /*details*/
49829
+ void 0,
49830
+ Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,
49831
+ packageId.name,
49832
+ moduleReference
49833
+ ) : chainDiagnosticMessages(
49834
+ /*details*/
49835
+ void 0,
49836
+ Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
49837
+ moduleReference,
49838
+ mangleScopedPackageName(packageId.name)
49839
+ );
49840
+ }
49830
49841
  errorOrSuggestion(isError, errorNode, chainDiagnosticMessages(
49831
49842
  errorInfo,
49832
49843
  Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,
@@ -51289,7 +51300,8 @@ function createTypeChecker(host) {
51289
51300
  const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
51290
51301
  forEach(symbol.declarations, (declaration) => declaration.parent.kind === 308 /* SourceFile */ || declaration.parent.kind === 265 /* ModuleBlock */));
51291
51302
  if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
51292
- return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a4 = context.visitedTypes) == null ? void 0 : _a4.has(typeId))) && (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
51303
+ return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a4 = context.visitedTypes) == null ? void 0 : _a4.has(typeId))) && // it is type of the symbol uses itself recursively
51304
+ (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
51293
51305
  }
51294
51306
  }
51295
51307
  }
@@ -51381,7 +51393,9 @@ function createTypeChecker(host) {
51381
51393
  const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
51382
51394
  if (some(abstractSignatures)) {
51383
51395
  const types = map(abstractSignatures, getOrCreateTypeFromSignature);
51384
- const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
51396
+ const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
51397
+ // the logic in `createTypeNodesFromResolvedType`.
51398
+ (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
51385
51399
  if (typeElementCount) {
51386
51400
  types.push(getResolvedTypeWithoutAbstractConstructSignatures(resolved));
51387
51401
  }
@@ -51480,13 +51494,17 @@ function createTypeChecker(host) {
51480
51494
  let qualifier = root.qualifier;
51481
51495
  if (qualifier) {
51482
51496
  if (isIdentifier(qualifier)) {
51483
- qualifier = factory.updateIdentifier(qualifier, typeArguments);
51497
+ if (typeArguments !== getIdentifierTypeArguments(qualifier)) {
51498
+ qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments);
51499
+ }
51484
51500
  } else {
51485
- qualifier = factory.updateQualifiedName(
51486
- qualifier,
51487
- qualifier.left,
51488
- factory.updateIdentifier(qualifier.right, typeArguments)
51489
- );
51501
+ if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) {
51502
+ qualifier = factory.updateQualifiedName(
51503
+ qualifier,
51504
+ qualifier.left,
51505
+ setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments)
51506
+ );
51507
+ }
51490
51508
  }
51491
51509
  }
51492
51510
  typeArguments = ref.typeArguments;
@@ -51506,13 +51524,17 @@ function createTypeChecker(host) {
51506
51524
  let typeArguments = root.typeArguments;
51507
51525
  let typeName = root.typeName;
51508
51526
  if (isIdentifier(typeName)) {
51509
- typeName = factory.updateIdentifier(typeName, typeArguments);
51527
+ if (typeArguments !== getIdentifierTypeArguments(typeName)) {
51528
+ typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments);
51529
+ }
51510
51530
  } else {
51511
- typeName = factory.updateQualifiedName(
51512
- typeName,
51513
- typeName.left,
51514
- factory.updateIdentifier(typeName.right, typeArguments)
51515
- );
51531
+ if (typeArguments !== getIdentifierTypeArguments(typeName.right)) {
51532
+ typeName = factory.updateQualifiedName(
51533
+ typeName,
51534
+ typeName.left,
51535
+ setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments)
51536
+ );
51537
+ }
51516
51538
  }
51517
51539
  typeArguments = ref.typeArguments;
51518
51540
  const ids = getAccessStack(ref);
@@ -52043,9 +52065,11 @@ function createTypeChecker(host) {
52043
52065
  if (accessibleSymbolChain) {
52044
52066
  return accessibleSymbolChain;
52045
52067
  }
52046
- if (// If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
52047
- endOfChain || // If a parent symbol is an anonymous type, don't write it.
52048
- !(symbol2.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) {
52068
+ if (
52069
+ // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
52070
+ endOfChain || // If a parent symbol is an anonymous type, don't write it.
52071
+ !(symbol2.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))
52072
+ ) {
52049
52073
  if (!endOfChain && !yieldModuleSymbol && !!forEach(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
52050
52074
  return;
52051
52075
  }
@@ -52224,7 +52248,11 @@ function createTypeChecker(host) {
52224
52248
  if (!nonRootParts || isEntityName(nonRootParts)) {
52225
52249
  if (nonRootParts) {
52226
52250
  const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right;
52227
- lastId.typeArguments = void 0;
52251
+ setIdentifierTypeArguments(
52252
+ lastId,
52253
+ /*typeArguments*/
52254
+ void 0
52255
+ );
52228
52256
  }
52229
52257
  return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf);
52230
52258
  } else {
@@ -52241,8 +52269,12 @@ function createTypeChecker(host) {
52241
52269
  return factory.createTypeQueryNode(entityName);
52242
52270
  } else {
52243
52271
  const lastId = isIdentifier(entityName) ? entityName : entityName.right;
52244
- const lastTypeArgs = lastId.typeArguments;
52245
- lastId.typeArguments = void 0;
52272
+ const lastTypeArgs = getIdentifierTypeArguments(lastId);
52273
+ setIdentifierTypeArguments(
52274
+ lastId,
52275
+ /*typeArguments*/
52276
+ void 0
52277
+ );
52246
52278
  return factory.createTypeReferenceNode(entityName, lastTypeArgs);
52247
52279
  }
52248
52280
  function createAccessFromSymbolChain(chain2, index, stopper) {
@@ -52286,7 +52318,9 @@ function createTypeChecker(host) {
52286
52318
  return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2)));
52287
52319
  }
52288
52320
  }
52289
- const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
52321
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
52322
+ if (typeParameterNodes)
52323
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
52290
52324
  identifier.symbol = symbol2;
52291
52325
  if (index > stopper) {
52292
52326
  const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper);
@@ -52344,7 +52378,9 @@ function createTypeChecker(host) {
52344
52378
  text = `${rawtext}_${i}`;
52345
52379
  }
52346
52380
  if (text !== rawtext) {
52347
- result = factory.createIdentifier(text, result.typeArguments);
52381
+ const typeArguments = getIdentifierTypeArguments(result);
52382
+ result = factory.createIdentifier(text);
52383
+ setIdentifierTypeArguments(result, typeArguments);
52348
52384
  }
52349
52385
  (context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
52350
52386
  (context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
@@ -52368,7 +52404,9 @@ function createTypeChecker(host) {
52368
52404
  if (index === 0) {
52369
52405
  context.flags ^= 16777216 /* InInitialEntityName */;
52370
52406
  }
52371
- const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
52407
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
52408
+ if (typeParameterNodes)
52409
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
52372
52410
  identifier.symbol = symbol2;
52373
52411
  return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier;
52374
52412
  }
@@ -52391,7 +52429,9 @@ function createTypeChecker(host) {
52391
52429
  return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context));
52392
52430
  }
52393
52431
  if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) {
52394
- const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
52432
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
52433
+ if (typeParameterNodes)
52434
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
52395
52435
  identifier.symbol = symbol2;
52396
52436
  return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier;
52397
52437
  } else {
@@ -52406,8 +52446,11 @@ function createTypeChecker(host) {
52406
52446
  expression = factory.createNumericLiteral(+symbolName2);
52407
52447
  }
52408
52448
  if (!expression) {
52409
- expression = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
52410
- expression.symbol = symbol2;
52449
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
52450
+ if (typeParameterNodes)
52451
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
52452
+ identifier.symbol = symbol2;
52453
+ expression = identifier;
52411
52454
  }
52412
52455
  return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression);
52413
52456
  }
@@ -52667,7 +52710,8 @@ function createTypeChecker(host) {
52667
52710
  }
52668
52711
  if (isLiteralImportTypeNode(node)) {
52669
52712
  const nodeSymbol = getNodeLinks(node).resolvedSymbol;
52670
- if (isInJSDoc(node) && nodeSymbol && (!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
52713
+ if (isInJSDoc(node) && nodeSymbol && // The import type resolved using jsdoc fallback logic
52714
+ (!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
52671
52715
  !(length(node.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))))) {
52672
52716
  return setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
52673
52717
  }
@@ -54184,8 +54228,10 @@ function createTypeChecker(host) {
54184
54228
  }
54185
54229
  }
54186
54230
  function getNameOfSymbolAsWritten(symbol, context) {
54187
- if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && (!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
54188
- !symbol.declarations || context.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context.enclosingDeclaration, isDefaultBindingContext))) {
54231
+ if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && // If it's not the first part of an entity name, it must print as `default`
54232
+ (!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
54233
+ !symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default`
54234
+ context.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context.enclosingDeclaration, isDefaultBindingContext))) {
54189
54235
  return "default";
54190
54236
  }
54191
54237
  if (symbol.declarations && symbol.declarations.length) {
@@ -55512,7 +55558,10 @@ function createTypeChecker(host) {
55512
55558
  function getWriteTypeOfSymbol(symbol) {
55513
55559
  const checkFlags = getCheckFlags(symbol);
55514
55560
  if (symbol.flags & 4 /* Property */) {
55515
- return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.links.writeType || symbol.links.type : getTypeOfSymbol(symbol);
55561
+ return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
55562
+ // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
55563
+ symbol.links.writeType || symbol.links.type
55564
+ ) : getTypeOfSymbol(symbol);
55516
55565
  }
55517
55566
  if (symbol.flags & 98304 /* Accessor */) {
55518
55567
  return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
@@ -63929,7 +63978,11 @@ function createTypeChecker(host) {
63929
63978
  if (variances === emptyArray) {
63930
63979
  return 1 /* Unknown */;
63931
63980
  }
63932
- const varianceResult = relateVariances(source2.aliasTypeArguments, target2.aliasTypeArguments, variances, intersectionState);
63981
+ const params = getSymbolLinks(source2.aliasSymbol).typeParameters;
63982
+ const minParams = getMinTypeArgumentCount(params);
63983
+ const sourceTypes = fillMissingTypeArguments(source2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration));
63984
+ const targetTypes = fillMissingTypeArguments(target2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration));
63985
+ const varianceResult = relateVariances(sourceTypes, targetTypes, variances, intersectionState);
63933
63986
  if (varianceResult !== void 0) {
63934
63987
  return varianceResult;
63935
63988
  }
@@ -65912,19 +65965,22 @@ function createTypeChecker(host) {
65912
65965
  break;
65913
65966
  case 166 /* Parameter */:
65914
65967
  const param = declaration;
65915
- if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
65916
- param,
65917
- param.name.escapedText,
65918
- 788968 /* Type */,
65919
- void 0,
65920
- param.name.escapedText,
65921
- /*isUse*/
65922
- true
65923
- ) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) {
65924
- const newName = "arg" + param.parent.parameters.indexOf(param);
65925
- const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
65926
- errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
65927
- return;
65968
+ if (isIdentifier(param.name)) {
65969
+ const originalKeywordKind = identifierToKeywordKind(param.name);
65970
+ if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
65971
+ param,
65972
+ param.name.escapedText,
65973
+ 788968 /* Type */,
65974
+ void 0,
65975
+ param.name.escapedText,
65976
+ /*isUse*/
65977
+ true
65978
+ ) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) {
65979
+ const newName = "arg" + param.parent.parameters.indexOf(param);
65980
+ const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
65981
+ errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
65982
+ return;
65983
+ }
65928
65984
  }
65929
65985
  diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
65930
65986
  break;
@@ -66112,6 +66168,10 @@ function createTypeChecker(host) {
66112
66168
  function isTypeParameterAtTopLevel(type, typeParameter) {
66113
66169
  return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter));
66114
66170
  }
66171
+ function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) {
66172
+ const typePredicate = getTypePredicateOfSignature(signature);
66173
+ return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter);
66174
+ }
66115
66175
  function createEmptyObjectTypeFromStringLiteral(type) {
66116
66176
  const members = createSymbolTable();
66117
66177
  forEachType(type, (t) => {
@@ -66386,7 +66446,11 @@ function createTypeChecker(host) {
66386
66446
  }
66387
66447
  if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
66388
66448
  if (source.aliasTypeArguments) {
66389
- inferFromTypeArguments(source.aliasTypeArguments, target.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
66449
+ const params = getSymbolLinks(source.aliasSymbol).typeParameters;
66450
+ const minParams = getMinTypeArgumentCount(params);
66451
+ const sourceTypes = fillMissingTypeArguments(source.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration));
66452
+ const targetTypes = fillMissingTypeArguments(target.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration));
66453
+ inferFromTypeArguments(sourceTypes, targetTypes, getAliasVariances(source.aliasSymbol));
66390
66454
  }
66391
66455
  return;
66392
66456
  }
@@ -66979,7 +67043,7 @@ function createTypeChecker(host) {
66979
67043
  function getCovariantInference(inference, signature) {
66980
67044
  const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
66981
67045
  const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter);
66982
- const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter));
67046
+ const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter));
66983
67047
  const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates;
66984
67048
  const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
66985
67049
  return getWidenedType(unwidenedType);
@@ -68793,18 +68857,20 @@ function createTypeChecker(host) {
68793
68857
  return narrowTypeByTypeFacts(type, nonPrimitiveType, 128 /* TypeofEQHostObject */);
68794
68858
  }
68795
68859
  function narrowTypeByTypeFacts(type, impliedType, facts) {
68796
- return mapType(type, (t) => // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate
68797
- // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
68798
- // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
68799
- // but are classified as "function" according to `typeof`.
68800
- isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : (
68801
- // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
68802
- // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
68803
- isTypeSubtypeOf(impliedType, t) ? impliedType : (
68804
- // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
68805
- // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
68806
- // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
68807
- getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType
68860
+ return mapType(type, (t) => (
68861
+ // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate
68862
+ // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
68863
+ // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
68864
+ // but are classified as "function" according to `typeof`.
68865
+ isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : (
68866
+ // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
68867
+ // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
68868
+ isTypeSubtypeOf(impliedType, t) ? impliedType : (
68869
+ // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
68870
+ // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
68871
+ // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
68872
+ getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType
68873
+ )
68808
68874
  )
68809
68875
  ));
68810
68876
  }
@@ -76375,7 +76441,8 @@ function createTypeChecker(host) {
76375
76441
  }
76376
76442
  }
76377
76443
  function isIndirectCall(node) {
76378
- return node.parent.kind === 214 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 212 /* TaggedTemplateExpression */) && (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval");
76444
+ return node.parent.kind === 214 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 212 /* TaggedTemplateExpression */) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior.
76445
+ (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval");
76379
76446
  }
76380
76447
  function checkForDisallowedESSymbolOperand(operator2) {
76381
76448
  const offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint(leftType, 12288 /* ESSymbolLike */) ? left : maybeTypeOfKindConsideringBaseConstraint(rightType, 12288 /* ESSymbolLike */) ? right : void 0;
@@ -77705,8 +77772,11 @@ function createTypeChecker(host) {
77705
77772
  }
77706
77773
  function checkTypeReferenceNode(node) {
77707
77774
  checkGrammarTypeArguments(node, node.typeArguments);
77708
- if (node.kind === 180 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
77709
- grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
77775
+ if (node.kind === 180 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) {
77776
+ const sourceFile = getSourceFileOfNode(node);
77777
+ if (scanTokenAtPosition(sourceFile, node.typeName.end) === 24 /* DotToken */) {
77778
+ grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
77779
+ }
77710
77780
  }
77711
77781
  forEach(node.typeArguments, checkSourceElement);
77712
77782
  const type = getTypeFromTypeReference(node);
@@ -83315,8 +83385,9 @@ function createTypeChecker(host) {
83315
83385
  }
83316
83386
  }
83317
83387
  function getReferencedImportDeclaration(nodeIn) {
83318
- if (nodeIn.generatedImportReference) {
83319
- return nodeIn.generatedImportReference;
83388
+ const specifier = getIdentifierGeneratedImportReference(nodeIn);
83389
+ if (specifier) {
83390
+ return specifier;
83320
83391
  }
83321
83392
  const node = getParseTreeNode(nodeIn, isIdentifier);
83322
83393
  if (node) {
@@ -83460,7 +83531,12 @@ function createTypeChecker(host) {
83460
83531
  return false;
83461
83532
  const symbol = getSymbolOfDeclaration(node);
83462
83533
  const signaturesOfSymbol = getSignaturesOfSymbol(symbol);
83463
- return signaturesOfSymbol.length > 1 || signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node;
83534
+ return signaturesOfSymbol.length > 1 || // If there is single signature for the symbol, it is overload if that signature isn't coming from the node
83535
+ // e.g.: function foo(a: string): string;
83536
+ // function foo(a: any) { // This is implementation of the overloads
83537
+ // return a;
83538
+ // }
83539
+ signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node;
83464
83540
  }
83465
83541
  return false;
83466
83542
  }
@@ -85289,7 +85365,7 @@ function createTypeChecker(host) {
85289
85365
  }
85290
85366
  function checkGrammarNameInLetOrConstDeclarations(name) {
85291
85367
  if (name.kind === 79 /* Identifier */) {
85292
- if (name.originalKeywordKind === 119 /* LetKeyword */) {
85368
+ if (name.escapedText === "let") {
85293
85369
  return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
85294
85370
  }
85295
85371
  } else {
@@ -86093,12 +86169,6 @@ function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, toke
86093
86169
  return fn === void 0 ? node : fn(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor);
86094
86170
  }
86095
86171
  var visitEachChildTable = {
86096
- [79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
86097
- return context.factory.updateIdentifier(
86098
- node,
86099
- nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)
86100
- );
86101
- },
86102
86172
  [163 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
86103
86173
  return context.factory.updateQualifiedName(
86104
86174
  node,
@@ -91311,7 +91381,7 @@ function transformClassFields(context) {
91311
91381
  if (isClassWithConstructorReference) {
91312
91382
  enableSubstitutionForClassAliases();
91313
91383
  const alias = factory2.cloneNode(temp);
91314
- alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
91384
+ alias.emitNode.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
91315
91385
  classAliases[getOriginalNodeId(node)] = alias;
91316
91386
  }
91317
91387
  setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression));
@@ -95447,7 +95517,7 @@ function transformJsx(context) {
95447
95517
  factory2.createIdentifier(name),
95448
95518
  generatedName
95449
95519
  );
95450
- generatedName.generatedImportReference = specifier;
95520
+ setIdentifierGeneratedImportReference(generatedName, specifier);
95451
95521
  specifierSourceImports.set(name, specifier);
95452
95522
  return generatedName;
95453
95523
  }
@@ -96590,7 +96660,7 @@ function transformES2015(context) {
96590
96660
  return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments"));
96591
96661
  }
96592
96662
  }
96593
- if (node.hasExtendedUnicodeEscape) {
96663
+ if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) {
96594
96664
  return setOriginalNode(setTextRange(
96595
96665
  factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)),
96596
96666
  node
@@ -99471,7 +99541,7 @@ function transformES5(context) {
99471
99541
  return node;
99472
99542
  }
99473
99543
  function trySubstituteReservedName(name) {
99474
- const token = name.originalKeywordKind || (nodeIsSynthesized(name) ? stringToToken(idText(name)) : void 0);
99544
+ const token = identifierToKeywordKind(name);
99475
99545
  if (token !== void 0 && token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */) {
99476
99546
  return setTextRange(factory2.createStringLiteralFromNode(name), name);
99477
99547
  }
@@ -103139,7 +103209,7 @@ function transformModule(context) {
103139
103209
  return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
103140
103210
  }
103141
103211
  return node;
103142
- } else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
103212
+ } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
103143
103213
  const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
103144
103214
  if (exportContainer && exportContainer.kind === 308 /* SourceFile */) {
103145
103215
  return setTextRange(
@@ -109103,7 +109173,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
109103
109173
  /*includeTrivia*/
109104
109174
  false
109105
109175
  ), node.symbol);
109106
- emitList(node, node.typeArguments, 53776 /* TypeParameters */);
109176
+ emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */);
109107
109177
  }
109108
109178
  function emitPrivateIdentifier(node) {
109109
109179
  write(getTextOfNode2(
@@ -111821,10 +111891,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111821
111891
  }
111822
111892
  }
111823
111893
  function generateName(name) {
111824
- if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
111825
- return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix);
111894
+ const autoGenerate = name.emitNode.autoGenerate;
111895
+ if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
111896
+ return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix);
111826
111897
  } else {
111827
- const autoGenerateId = name.autoGenerate.id;
111898
+ const autoGenerateId = autoGenerate.id;
111828
111899
  return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name));
111829
111900
  }
111830
111901
  }
@@ -112104,16 +112175,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
112104
112175
  }
112105
112176
  }
112106
112177
  function makeName(name) {
112107
- const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName);
112108
- const suffix = formatGeneratedNamePart(name.autoGenerate.suffix);
112109
- switch (name.autoGenerate.flags & 7 /* KindMask */) {
112178
+ const autoGenerate = name.emitNode.autoGenerate;
112179
+ const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName);
112180
+ const suffix = formatGeneratedNamePart(autoGenerate.suffix);
112181
+ switch (autoGenerate.flags & 7 /* KindMask */) {
112110
112182
  case 1 /* Auto */:
112111
- return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
112183
+ return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
112112
112184
  case 2 /* Loop */:
112113
112185
  Debug.assertNode(name, isIdentifier);
112114
112186
  return makeTempVariableName(
112115
112187
  TempFlags._i,
112116
- !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
112188
+ !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */),
112117
112189
  /*privateName*/
112118
112190
  false,
112119
112191
  prefix,
@@ -112122,16 +112194,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
112122
112194
  case 3 /* Unique */:
112123
112195
  return makeUniqueName2(
112124
112196
  idText(name),
112125
- name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
112126
- !!(name.autoGenerate.flags & 16 /* Optimistic */),
112127
- !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
112197
+ autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
112198
+ !!(autoGenerate.flags & 16 /* Optimistic */),
112199
+ !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */),
112128
112200
  isPrivateIdentifier(name),
112129
112201
  prefix,
112130
112202
  suffix
112131
112203
  );
112132
112204
  }
112133
112205
  return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(
112134
- name.autoGenerate.flags & 7 /* KindMask */,
112206
+ autoGenerate.flags & 7 /* KindMask */,
112135
112207
  GeneratedIdentifierFlags,
112136
112208
  /*isFlags*/
112137
112209
  true
@@ -114115,7 +114187,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
114115
114187
  const oldSourceFiles = oldProgram.getSourceFiles();
114116
114188
  for (const oldSourceFile of oldSourceFiles) {
114117
114189
  const newFile = getSourceFileByPath(oldSourceFile.resolvedPath);
114118
- if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) {
114190
+ if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || // old file wasn't redirect but new file is
114191
+ oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) {
114119
114192
  host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path));
114120
114193
  }
114121
114194
  }
@@ -118843,7 +118916,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118843
118916
  const name = loader.nameAndMode.getName(entry);
118844
118917
  const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
118845
118918
  let resolution = resolutionsInFile.get(name, mode);
118846
- if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
118919
+ if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate
118920
+ hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
118847
118921
  const existingResolution = resolution;
118848
118922
  resolution = loader.resolve(name, mode);
118849
118923
  if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
@@ -123364,6 +123438,7 @@ __export(ts_exports3, {
123364
123438
  addEmitHelper: () => addEmitHelper,
123365
123439
  addEmitHelpers: () => addEmitHelpers,
123366
123440
  addNodeFactoryPatcher: () => addNodeFactoryPatcher,
123441
+ addObjectAllocatorPatcher: () => addObjectAllocatorPatcher,
123367
123442
  addRange: () => addRange,
123368
123443
  addRelatedInfo: () => addRelatedInfo,
123369
123444
  addSyntheticLeadingComment: () => addSyntheticLeadingComment,
@@ -124132,6 +124207,9 @@ __export(ts_exports3, {
124132
124207
  getGeneratedNameForNode: () => getGeneratedNameForNode,
124133
124208
  getHeritageClause: () => getHeritageClause,
124134
124209
  getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc,
124210
+ getIdentifierAutoGenerate: () => getIdentifierAutoGenerate,
124211
+ getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference,
124212
+ getIdentifierTypeArguments: () => getIdentifierTypeArguments,
124135
124213
  getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression,
124136
124214
  getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile,
124137
124215
  getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker,
@@ -124465,6 +124543,7 @@ __export(ts_exports3, {
124465
124543
  hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames,
124466
124544
  idText: () => idText,
124467
124545
  identifierIsThisKeyword: () => identifierIsThisKeyword,
124546
+ identifierToKeywordKind: () => identifierToKeywordKind,
124468
124547
  identity: () => identity,
124469
124548
  identitySourceMapConsumer: () => identitySourceMapConsumer,
124470
124549
  ignoreSourceNewlines: () => ignoreSourceNewlines,
@@ -125354,6 +125433,7 @@ __export(ts_exports3, {
125354
125433
  sameMap: () => sameMap,
125355
125434
  sameMapping: () => sameMapping,
125356
125435
  scanShebangTrivia: () => scanShebangTrivia,
125436
+ scanTokenAtPosition: () => scanTokenAtPosition,
125357
125437
  scanner: () => scanner,
125358
125438
  screenStartingMessageCodes: () => screenStartingMessageCodes,
125359
125439
  semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations,
@@ -125366,6 +125446,9 @@ __export(ts_exports3, {
125366
125446
  setEachParent: () => setEachParent,
125367
125447
  setEmitFlags: () => setEmitFlags,
125368
125448
  setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned,
125449
+ setIdentifierAutoGenerate: () => setIdentifierAutoGenerate,
125450
+ setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference,
125451
+ setIdentifierTypeArguments: () => setIdentifierTypeArguments,
125369
125452
  setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages,
125370
125453
  setModuleDefaultHelper: () => setModuleDefaultHelper,
125371
125454
  setNodeFlags: () => setNodeFlags,
@@ -126976,7 +127059,11 @@ function findNextToken(previousToken, parent2, sourceFile) {
126976
127059
  return n;
126977
127060
  }
126978
127061
  return firstDefined(n.getChildren(sourceFile), (child) => {
126979
- const shouldDiveInChildNode = child.pos <= previousToken.pos && child.end > previousToken.end || child.pos === previousToken.end;
127062
+ const shouldDiveInChildNode = (
127063
+ // previous token is enclosed somewhere in the child
127064
+ child.pos <= previousToken.pos && child.end > previousToken.end || // previous token ends exactly at the beginning of child
127065
+ child.pos === previousToken.end
127066
+ );
126980
127067
  return shouldDiveInChildNode && nodeHasTokens(child, sourceFile) ? find2(child) : void 0;
126981
127068
  });
126982
127069
  }
@@ -139039,8 +139126,8 @@ function convertFileToEsModule(sourceFile, checker, changes, target, quotePrefer
139039
139126
  function collectExportRenames(sourceFile, checker, identifiers) {
139040
139127
  const res = /* @__PURE__ */ new Map();
139041
139128
  forEachExportReference(sourceFile, (node) => {
139042
- const { text, originalKeywordKind } = node.name;
139043
- if (!res.has(text) && (originalKeywordKind !== void 0 && isNonContextualKeyword(originalKeywordKind) || checker.resolveName(
139129
+ const { text } = node.name;
139130
+ if (!res.has(text) && (isIdentifierANonContextualKeyword(node.name) || checker.resolveName(
139044
139131
  text,
139045
139132
  node,
139046
139133
  111551 /* Value */,
@@ -140435,15 +140522,17 @@ function getBestFix(fixes, sourceFile, program, packageJsonImportFilter, host) {
140435
140522
  return fixes[0];
140436
140523
  }
140437
140524
  return fixes.reduce(
140438
- (best, fix) => // Takes true branch of conditional if `fix` is better than `best`
140439
- compareModuleSpecifiers(
140440
- fix,
140441
- best,
140442
- sourceFile,
140443
- program,
140444
- packageJsonImportFilter.allowsImportingSpecifier,
140445
- (fileName) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host))
140446
- ) === -1 /* LessThan */ ? fix : best
140525
+ (best, fix) => (
140526
+ // Takes true branch of conditional if `fix` is better than `best`
140527
+ compareModuleSpecifiers(
140528
+ fix,
140529
+ best,
140530
+ sourceFile,
140531
+ program,
140532
+ packageJsonImportFilter.allowsImportingSpecifier,
140533
+ (fileName) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host))
140534
+ ) === -1 /* LessThan */ ? fix : best
140535
+ )
140447
140536
  );
140448
140537
  }
140449
140538
  function compareModuleSpecifiers(a, b, importingFile, program, allowsImportingSpecifier, toPath3) {
@@ -147640,8 +147729,11 @@ function isModifierLike2(node) {
147640
147729
  if (isModifier(node)) {
147641
147730
  return node.kind;
147642
147731
  }
147643
- if (isIdentifier(node) && node.originalKeywordKind && isModifierKind(node.originalKeywordKind)) {
147644
- return node.originalKeywordKind;
147732
+ if (isIdentifier(node)) {
147733
+ const originalKeywordKind = identifierToKeywordKind(node);
147734
+ if (originalKeywordKind && isModifierKind(originalKeywordKind)) {
147735
+ return originalKeywordKind;
147736
+ }
147645
147737
  }
147646
147738
  return void 0;
147647
147739
  }
@@ -149431,7 +149523,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
149431
149523
  return containingNodeKind === 257 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 240 /* VariableStatement */ || containingNodeKind === 263 /* EnumDeclaration */ || // enum a { foo, |
149432
149524
  isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 261 /* InterfaceDeclaration */ || // interface A<T, |
149433
149525
  containingNodeKind === 204 /* ArrayBindingPattern */ || // var [x, y|
149434
- containingNodeKind === 262 /* TypeAliasDeclaration */ || isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
149526
+ containingNodeKind === 262 /* TypeAliasDeclaration */ || // type Map, K, |
149527
+ // class A<T, |
149528
+ // var C = class D<T, |
149529
+ isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
149435
149530
  case 24 /* DotToken */:
149436
149531
  return containingNodeKind === 204 /* ArrayBindingPattern */;
149437
149532
  case 58 /* ColonToken */:
@@ -149837,7 +149932,8 @@ function isFunctionLikeBodyKeyword(kind) {
149837
149932
  return kind === 132 /* AsyncKeyword */ || kind === 133 /* AwaitKeyword */ || kind === 128 /* AsKeyword */ || kind === 150 /* SatisfiesKeyword */ || kind === 154 /* TypeKeyword */ || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
149838
149933
  }
149839
149934
  function keywordForNode(node) {
149840
- return isIdentifier(node) ? node.originalKeywordKind || 0 /* Unknown */ : node.kind;
149935
+ var _a2;
149936
+ return isIdentifier(node) ? (_a2 = identifierToKeywordKind(node)) != null ? _a2 : 0 /* Unknown */ : node.kind;
149841
149937
  }
149842
149938
  function getContextualKeywords(contextToken, position) {
149843
149939
  const entries = [];
@@ -149883,6 +149979,7 @@ function getPropertiesForCompletion(type, checker) {
149883
149979
  return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined");
149884
149980
  }
149885
149981
  function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) {
149982
+ var _a2;
149886
149983
  switch (location.kind) {
149887
149984
  case 353 /* SyntaxList */:
149888
149985
  return tryCast(location.parent, isObjectTypeDeclaration);
@@ -149893,8 +149990,8 @@ function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken
149893
149990
  }
149894
149991
  break;
149895
149992
  case 79 /* Identifier */: {
149896
- const originalKeywordKind = location.originalKeywordKind;
149897
- if (originalKeywordKind && isKeyword(originalKeywordKind)) {
149993
+ const originalKeywordKind = identifierToKeywordKind(location);
149994
+ if (originalKeywordKind) {
149898
149995
  return void 0;
149899
149996
  }
149900
149997
  if (isPropertyDeclaration(location.parent) && location.parent.initializer === location) {
@@ -149927,7 +150024,7 @@ function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken
149927
150024
  return void 0;
149928
150025
  }
149929
150026
  const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword;
149930
- return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword(stringToToken(contextToken.text)) ? contextToken.parent.parent : void 0;
150027
+ return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword((_a2 = identifierToKeywordKind(contextToken)) != null ? _a2 : 0 /* Unknown */) ? contextToken.parent.parent : void 0;
149931
150028
  }
149932
150029
  }
149933
150030
  function tryGetTypeLiteralNode(node) {
@@ -151376,8 +151473,10 @@ function getDirectImportsMap(sourceFiles, checker, cancellationToken) {
151376
151473
  return map2;
151377
151474
  }
151378
151475
  function forEachPossibleImportOrExportStatement(sourceFileLike, action) {
151379
- return forEach(sourceFileLike.kind === 308 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => // TODO: GH#18217
151380
- action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action));
151476
+ return forEach(sourceFileLike.kind === 308 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => (
151477
+ // TODO: GH#18217
151478
+ action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action)
151479
+ ));
151381
151480
  }
151382
151481
  function forEachImport(sourceFile, action) {
151383
151482
  if (sourceFile.externalModuleIndicator || sourceFile.imports !== void 0) {
@@ -151645,7 +151744,9 @@ function getContextNodeForNodeEntry(node) {
151645
151744
  return propertyName ? getContextNode(propertyName.parent) : void 0;
151646
151745
  }
151647
151746
  if (node.parent.name === node || // node is name of declaration, use parent
151648
- isConstructorDeclaration(node.parent) || isExportAssignment(node.parent) || (isImportOrExportSpecifier(node.parent) || isBindingElement(node.parent)) && node.parent.propertyName === node || node.kind === 88 /* DefaultKeyword */ && hasSyntacticModifier(node.parent, 1025 /* ExportDefault */)) {
151747
+ isConstructorDeclaration(node.parent) || isExportAssignment(node.parent) || // Property name of the import export specifier or binding pattern, use parent
151748
+ (isImportOrExportSpecifier(node.parent) || isBindingElement(node.parent)) && node.parent.propertyName === node || // Is default export
151749
+ node.kind === 88 /* DefaultKeyword */ && hasSyntacticModifier(node.parent, 1025 /* ExportDefault */)) {
151649
151750
  return getContextNode(node.parent);
151650
151751
  }
151651
151752
  return void 0;
@@ -151705,11 +151806,13 @@ function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFi
151705
151806
  const checker = program.getTypeChecker();
151706
151807
  const adjustedNode = Core.getAdjustedNode(node, options);
151707
151808
  const symbol = isDefinitionForReference(adjustedNode) ? checker.getSymbolAtLocation(adjustedNode) : void 0;
151708
- return !referencedSymbols || !referencedSymbols.length ? void 0 : mapDefined(referencedSymbols, ({ definition, references }) => // Only include referenced symbols that have a valid definition.
151709
- definition && {
151710
- definition: checker.runWithCancellationToken(cancellationToken, (checker2) => definitionToReferencedSymbolDefinitionInfo(definition, checker2, node)),
151711
- references: references.map((r) => toReferencedSymbolEntry(r, symbol))
151712
- });
151809
+ return !referencedSymbols || !referencedSymbols.length ? void 0 : mapDefined(referencedSymbols, ({ definition, references }) => (
151810
+ // Only include referenced symbols that have a valid definition.
151811
+ definition && {
151812
+ definition: checker.runWithCancellationToken(cancellationToken, (checker2) => definitionToReferencedSymbolDefinitionInfo(definition, checker2, node)),
151813
+ references: references.map((r) => toReferencedSymbolEntry(r, symbol))
151814
+ }
151815
+ ));
151713
151816
  }
151714
151817
  function isDefinitionForReference(node) {
151715
151818
  return node.kind === 88 /* DefaultKeyword */ || !!getDeclarationFromName(node) || isLiteralComputedPropertyDeclarationName(node) || node.kind === 135 /* ConstructorKeyword */ && isConstructorDeclaration(node.parent);
@@ -152719,8 +152822,10 @@ var Core;
152719
152822
  function getLabelReferencesInNode(container, targetLabel) {
152720
152823
  const sourceFile = container.getSourceFile();
152721
152824
  const labelName = targetLabel.text;
152722
- const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), (node) => // Only pick labels that are either the target label, or have a target that is the target label
152723
- node === targetLabel || isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel ? nodeEntry(node) : void 0);
152825
+ const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), (node) => (
152826
+ // Only pick labels that are either the target label, or have a target that is the target label
152827
+ node === targetLabel || isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel ? nodeEntry(node) : void 0
152828
+ ));
152724
152829
  return [{ definition: { type: 1 /* Label */, node: targetLabel }, references }];
152725
152830
  }
152726
152831
  function isValidReferencePosition(node, searchSymbolName) {
@@ -152856,7 +152961,7 @@ var Core;
152856
152961
  }
152857
152962
  }
152858
152963
  if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) {
152859
- const isDefaultExport = referenceLocation.originalKeywordKind === 88 /* DefaultKeyword */ || exportSpecifier.name.originalKeywordKind === 88 /* DefaultKeyword */;
152964
+ const isDefaultExport = referenceLocation.escapedText === "default" || exportSpecifier.name.escapedText === "default";
152860
152965
  const exportKind = isDefaultExport ? 1 /* Default */ : 0 /* Named */;
152861
152966
  const exportSymbol = Debug.checkDefined(exportSpecifier.symbol);
152862
152967
  const exportInfo = getExportInfo(exportSymbol, exportKind, state.checker);
@@ -159603,7 +159708,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont
159603
159708
  111551 /* Value */,
159604
159709
  /*excludeGlobals*/
159605
159710
  false
159606
- ) && !isPrivateIdentifier(node.name) && !isKeyword(node.name.originalKeywordKind) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file);
159711
+ ) && !isPrivateIdentifier(node.name) && !identifierToKeywordKind(node.name) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file);
159607
159712
  const isJS = isInJSFile(scope);
159608
159713
  let variableType = isJS || !checker.isContextSensitive(node) ? void 0 : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */);
159609
159714
  let initializer = transformConstantInitializer(skipParentheses(node), substitutions);
@@ -160473,7 +160578,7 @@ function getRenameInfoForNode(node, typeChecker, sourceFile, program, preference
160473
160578
  if (declarations.some((declaration) => isDefinedInLibraryFile(program, declaration))) {
160474
160579
  return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);
160475
160580
  }
160476
- if (isIdentifier(node) && node.originalKeywordKind === 88 /* DefaultKeyword */ && symbol.parent && symbol.parent.flags & 1536 /* Module */) {
160581
+ if (isIdentifier(node) && node.escapedText === "default" && symbol.parent && symbol.parent.flags & 1536 /* Module */) {
160477
160582
  return void 0;
160478
160583
  }
160479
160584
  if (isStringLiteralLike(node) && tryGetImportFromModuleSpecifier(node)) {
@@ -161548,7 +161653,8 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
161548
161653
  hasAddedSymbolInfo = true;
161549
161654
  hasMultipleSignatures = allSignatures.length > 1;
161550
161655
  }
161551
- } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || location.kind === 135 /* ConstructorKeyword */ && location.parent.kind === 173 /* Constructor */) {
161656
+ } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || // name of function declaration
161657
+ location.kind === 135 /* ConstructorKeyword */ && location.parent.kind === 173 /* Constructor */) {
161552
161658
  const functionDeclaration = location.parent;
161553
161659
  const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, (declaration) => declaration === (location.kind === 135 /* ConstructorKeyword */ ? functionDeclaration.parent : functionDeclaration));
161554
161660
  if (locationIsSymbolDeclaration) {
@@ -162680,7 +162786,6 @@ function updateJSDocHost(parent2) {
162680
162786
  }
162681
162787
  const jsDocNode = parent2.parent.kind === 169 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent;
162682
162788
  jsDocNode.jsDoc = parent2.jsDoc;
162683
- jsDocNode.jsDocCache = parent2.jsDocCache;
162684
162789
  return jsDocNode;
162685
162790
  }
162686
162791
  function tryMergeJsdocTags(oldTag, newTag) {
@@ -163855,18 +163960,12 @@ function getAllRules() {
163855
163960
  rule("NoSpaceBetweenCloseParenAndAngularBracket", 21 /* CloseParenToken */, 29 /* LessThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),
163856
163961
  rule("NoSpaceAfterOpenAngularBracket", 29 /* LessThanToken */, anyToken, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),
163857
163962
  rule("NoSpaceBeforeCloseAngularBracket", anyToken, 31 /* GreaterThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),
163858
- rule(
163859
- "NoSpaceAfterCloseAngularBracket",
163860
- 31 /* GreaterThanToken */,
163861
- [20 /* OpenParenToken */, 22 /* OpenBracketToken */, 31 /* GreaterThanToken */, 27 /* CommaToken */],
163862
- [
163863
- isNonJsxSameLineTokenContext,
163864
- isTypeArgumentOrParameterOrAssertionContext,
163865
- isNotFunctionDeclContext
163866
- /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/
163867
- ],
163868
- 16 /* DeleteSpace */
163869
- ),
163963
+ rule("NoSpaceAfterCloseAngularBracket", 31 /* GreaterThanToken */, [20 /* OpenParenToken */, 22 /* OpenBracketToken */, 31 /* GreaterThanToken */, 27 /* CommaToken */], [
163964
+ isNonJsxSameLineTokenContext,
163965
+ isTypeArgumentOrParameterOrAssertionContext,
163966
+ isNotFunctionDeclContext,
163967
+ isNonTypeAssertionContext
163968
+ ], 16 /* DeleteSpace */),
163870
163969
  // decorators
163871
163970
  rule("SpaceBeforeAt", [21 /* CloseParenToken */, 79 /* Identifier */], 59 /* AtToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),
163872
163971
  rule("NoSpaceAfterAt", 59 /* AtToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),
@@ -164299,6 +164398,9 @@ function isTypeArgumentOrParameterOrAssertionContext(context) {
164299
164398
  function isTypeAssertionContext(context) {
164300
164399
  return context.contextNode.kind === 213 /* TypeAssertionExpression */;
164301
164400
  }
164401
+ function isNonTypeAssertionContext(context) {
164402
+ return !isTypeAssertionContext(context);
164403
+ }
164302
164404
  function isVoidOpContext(context) {
164303
164405
  return context.currentTokenSpan.kind === 114 /* VoidKeyword */ && context.currentTokenParent.kind === 219 /* VoidExpression */;
164304
164406
  }
@@ -166061,7 +166163,7 @@ function createDeprecation(name, options = {}) {
166061
166163
  const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter;
166062
166164
  const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter;
166063
166165
  const since = typeof options.since === "string" ? new Version(options.since) : (_b = options.since) != null ? _b : warnAfter;
166064
- const error = options.error || errorAfter && version2.compareTo(errorAfter) <= 0;
166166
+ const error = options.error || errorAfter && version2.compareTo(errorAfter) >= 0;
166065
166167
  const warn = !warnAfter || version2.compareTo(warnAfter) >= 0;
166066
166168
  return error ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop;
166067
166169
  }
@@ -166438,8 +166540,6 @@ var createToken = deprecate(function createToken2(kind) {
166438
166540
  var createIdentifier = deprecate(function createIdentifier2(text) {
166439
166541
  return factory.createIdentifier(
166440
166542
  text,
166441
- /*typeArguments*/
166442
- void 0,
166443
166543
  /*originalKeywordKind*/
166444
166544
  void 0
166445
166545
  );
@@ -167392,6 +167492,37 @@ function patchNodeFactory4(factory2) {
167392
167492
  addNodeFactoryPatcher(patchNodeFactory4);
167393
167493
  patchNodeFactory4(factory);
167394
167494
 
167495
+ // src/deprecatedCompat/5.0/identifierProperties.ts
167496
+ addObjectAllocatorPatcher((objectAllocator2) => {
167497
+ const Identifier75 = objectAllocator2.getIdentifierConstructor();
167498
+ if (!hasProperty(Identifier75.prototype, "originalKeywordKind")) {
167499
+ Object.defineProperty(Identifier75.prototype, "originalKeywordKind", {
167500
+ get: deprecate(function() {
167501
+ return identifierToKeywordKind(this);
167502
+ }, {
167503
+ name: "originalKeywordKind",
167504
+ since: "5.0",
167505
+ warnAfter: "5.1",
167506
+ errorAfter: "5.2",
167507
+ message: "Use 'identifierToKeywordKind(identifier)' instead."
167508
+ })
167509
+ });
167510
+ }
167511
+ if (!hasProperty(Identifier75.prototype, "isInJSDocNamespace")) {
167512
+ Object.defineProperty(Identifier75.prototype, "isInJSDocNamespace", {
167513
+ get: deprecate(function() {
167514
+ return this.flags & 2048 /* IdentifierIsInJSDocNamespace */ ? true : void 0;
167515
+ }, {
167516
+ name: "isInJSDocNamespace",
167517
+ since: "5.0",
167518
+ warnAfter: "5.1",
167519
+ errorAfter: "5.2",
167520
+ message: "Use '.parent' or the surrounding context to determine this instead."
167521
+ })
167522
+ });
167523
+ }
167524
+ });
167525
+
167395
167526
  // src/server/utilitiesPublic.ts
167396
167527
  var LogLevel2 = /* @__PURE__ */ ((LogLevel3) => {
167397
167528
  LogLevel3[LogLevel3["terse"] = 0] = "terse";
@@ -172377,7 +172508,8 @@ var _ProjectService = class {
172377
172508
  });
172378
172509
  }
172379
172510
  getOrCreateInferredProjectForProjectRootPathIfEnabled(info, projectRootPath) {
172380
- if (!this.useInferredProjectPerProjectRoot || info.isDynamic && projectRootPath === void 0) {
172511
+ if (!this.useInferredProjectPerProjectRoot || // Its a dynamic info opened without project root
172512
+ info.isDynamic && projectRootPath === void 0) {
172381
172513
  return void 0;
172382
172514
  }
172383
172515
  if (projectRootPath) {
@@ -178943,6 +179075,7 @@ start(initializeNodeSystem(), require("os").platform());
178943
179075
  addEmitHelper,
178944
179076
  addEmitHelpers,
178945
179077
  addNodeFactoryPatcher,
179078
+ addObjectAllocatorPatcher,
178946
179079
  addRange,
178947
179080
  addRelatedInfo,
178948
179081
  addSyntheticLeadingComment,
@@ -179711,6 +179844,9 @@ start(initializeNodeSystem(), require("os").platform());
179711
179844
  getGeneratedNameForNode,
179712
179845
  getHeritageClause,
179713
179846
  getHostSignatureFromJSDoc,
179847
+ getIdentifierAutoGenerate,
179848
+ getIdentifierGeneratedImportReference,
179849
+ getIdentifierTypeArguments,
179714
179850
  getImmediatelyInvokedFunctionExpression,
179715
179851
  getImpliedNodeFormatForFile,
179716
179852
  getImpliedNodeFormatForFileWorker,
@@ -180044,6 +180180,7 @@ start(initializeNodeSystem(), require("os").platform());
180044
180180
  hostUsesCaseSensitiveFileNames,
180045
180181
  idText,
180046
180182
  identifierIsThisKeyword,
180183
+ identifierToKeywordKind,
180047
180184
  identity,
180048
180185
  identitySourceMapConsumer,
180049
180186
  ignoreSourceNewlines,
@@ -180933,6 +181070,7 @@ start(initializeNodeSystem(), require("os").platform());
180933
181070
  sameMap,
180934
181071
  sameMapping,
180935
181072
  scanShebangTrivia,
181073
+ scanTokenAtPosition,
180936
181074
  scanner,
180937
181075
  screenStartingMessageCodes,
180938
181076
  semanticDiagnosticsOptionDeclarations,
@@ -180945,6 +181083,9 @@ start(initializeNodeSystem(), require("os").platform());
180945
181083
  setEachParent,
180946
181084
  setEmitFlags,
180947
181085
  setGetSourceFileAsHashVersioned,
181086
+ setIdentifierAutoGenerate,
181087
+ setIdentifierGeneratedImportReference,
181088
+ setIdentifierTypeArguments,
180948
181089
  setLocalizedDiagnosticMessages,
180949
181090
  setModuleDefaultHelper,
180950
181091
  setNodeFlags,