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/tsc.js CHANGED
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-dev.20230111`;
26
+ var version = `${versionMajorMinor}.0-dev.20230113`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -3525,6 +3525,8 @@ var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => {
3525
3525
  NodeFlags3[NodeFlags3["ContextFlags"] = 50720768] = "ContextFlags";
3526
3526
  NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags";
3527
3527
  NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags";
3528
+ NodeFlags3[NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape";
3529
+ NodeFlags3[NodeFlags3["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace";
3528
3530
  return NodeFlags3;
3529
3531
  })(NodeFlags || {});
3530
3532
  var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => {
@@ -7145,6 +7147,8 @@ var Diagnostics = {
7145
7147
  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."),
7146
7148
  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}'"),
7147
7149
  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}'."),
7150
+ 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."),
7151
+ 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.`),
7148
7152
  Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
7149
7153
  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."),
7150
7154
  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}'."),
@@ -8404,7 +8408,8 @@ function isIdentifierStart(ch, languageVersion) {
8404
8408
  return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
8405
8409
  }
8406
8410
  function isIdentifierPart(ch, languageVersion, identifierVariant) {
8407
- 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);
8411
+ 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
8412
+ (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
8408
8413
  }
8409
8414
  function isIdentifierText(name, languageVersion, identifierVariant) {
8410
8415
  let ch = codePointAt(name, 0);
@@ -10107,6 +10112,10 @@ function unescapeLeadingUnderscores(identifier) {
10107
10112
  function idText(identifierOrPrivateName) {
10108
10113
  return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText);
10109
10114
  }
10115
+ function identifierToKeywordKind(node) {
10116
+ const token = stringToToken(node.escapedText);
10117
+ return token ? tryCast(token, isKeyword) : void 0;
10118
+ }
10110
10119
  function symbolName(symbol) {
10111
10120
  if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) {
10112
10121
  return idText(symbol.valueDeclaration.name);
@@ -10399,15 +10408,17 @@ function getJSDocReturnType(node) {
10399
10408
  }
10400
10409
  }
10401
10410
  function getJSDocTagsWorker(node, noCache) {
10411
+ var _a2, _b;
10402
10412
  if (!canHaveJSDoc(node))
10403
10413
  return emptyArray;
10404
- let tags = node.jsDocCache;
10414
+ let tags = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache;
10405
10415
  if (tags === void 0 || noCache) {
10406
10416
  const comments = getJSDocCommentsAndTags(node, noCache);
10407
10417
  Debug.assert(comments.length < 2 || comments[0] !== comments[1]);
10408
10418
  tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j);
10409
10419
  if (!noCache) {
10410
- node.jsDocCache = tags;
10420
+ (_b = node.jsDoc) != null ? _b : node.jsDoc = [];
10421
+ node.jsDoc.jsDocCache = tags;
10411
10422
  }
10412
10423
  }
10413
10424
  return tags;
@@ -10584,10 +10595,12 @@ function isAssertionKey(node) {
10584
10595
  return isStringLiteral(node) || isIdentifier(node);
10585
10596
  }
10586
10597
  function isGeneratedIdentifier(node) {
10587
- return isIdentifier(node) && node.autoGenerate !== void 0;
10598
+ var _a2;
10599
+ return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0;
10588
10600
  }
10589
10601
  function isGeneratedPrivateIdentifier(node) {
10590
- return isPrivateIdentifier(node) && node.autoGenerate !== void 0;
10602
+ var _a2;
10603
+ return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0;
10591
10604
  }
10592
10605
  function isPrivateIdentifierClassElementDeclaration(node) {
10593
10606
  return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name);
@@ -11831,10 +11844,11 @@ function isComputedNonLiteralName(name) {
11831
11844
  return name.kind === 164 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
11832
11845
  }
11833
11846
  function tryGetTextOfPropertyName(name) {
11847
+ var _a2;
11834
11848
  switch (name.kind) {
11835
11849
  case 79 /* Identifier */:
11836
11850
  case 80 /* PrivateIdentifier */:
11837
- return name.autoGenerate ? void 0 : name.escapedText;
11851
+ return ((_a2 = name.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name.escapedText;
11838
11852
  case 10 /* StringLiteral */:
11839
11853
  case 8 /* NumericLiteral */:
11840
11854
  case 14 /* NoSubstitutionTemplateLiteral */:
@@ -11952,6 +11966,20 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
11952
11966
  const start = scanner.getTokenPos();
11953
11967
  return createTextSpanFromBounds(start, scanner.getTextPos());
11954
11968
  }
11969
+ function scanTokenAtPosition(sourceFile, pos) {
11970
+ const scanner = createScanner(
11971
+ sourceFile.languageVersion,
11972
+ /*skipTrivia*/
11973
+ true,
11974
+ sourceFile.languageVariant,
11975
+ sourceFile.text,
11976
+ /*onError:*/
11977
+ void 0,
11978
+ pos
11979
+ );
11980
+ scanner.scan();
11981
+ return scanner.getToken();
11982
+ }
11955
11983
  function getErrorSpanForArrowFunction(sourceFile, node) {
11956
11984
  const pos = skipTrivia(sourceFile.text, node.pos);
11957
11985
  if (node.body && node.body.kind === 238 /* Block */) {
@@ -13552,7 +13580,8 @@ function isStringANonContextualKeyword(name) {
13552
13580
  const token = stringToToken(name);
13553
13581
  return token !== void 0 && isNonContextualKeyword(token);
13554
13582
  }
13555
- function isIdentifierANonContextualKeyword({ originalKeywordKind }) {
13583
+ function isIdentifierANonContextualKeyword(node) {
13584
+ const originalKeywordKind = identifierToKeywordKind(node);
13556
13585
  return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind);
13557
13586
  }
13558
13587
  function getFunctionFlags(node) {
@@ -14364,7 +14393,7 @@ function isThisInTypeQuery(node) {
14364
14393
  return node.parent.kind === 183 /* TypeQuery */;
14365
14394
  }
14366
14395
  function identifierIsThisKeyword(id) {
14367
- return id.originalKeywordKind === 108 /* ThisKeyword */;
14396
+ return id.escapedText === "this";
14368
14397
  }
14369
14398
  function getAllAccessorDeclarations(declarations, accessor) {
14370
14399
  let firstAccessor;
@@ -14663,7 +14692,7 @@ function getEffectiveModifierFlagsNoCache(node) {
14663
14692
  }
14664
14693
  function getSyntacticModifierFlagsNoCache(node) {
14665
14694
  let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */;
14666
- if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.isInJSDocNamespace) {
14695
+ if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
14667
14696
  flags |= 1 /* Export */;
14668
14697
  }
14669
14698
  return flags;
@@ -15300,7 +15329,6 @@ function Identifier2(kind, pos, end) {
15300
15329
  this.parent = void 0;
15301
15330
  this.original = void 0;
15302
15331
  this.emitNode = void 0;
15303
- this.flowNode = void 0;
15304
15332
  }
15305
15333
  function SourceMapSource(fileName, text, skipTrivia2) {
15306
15334
  this.fileName = fileName;
@@ -17246,7 +17274,6 @@ function createNodeFactory(flags, baseFactory2) {
17246
17274
  createRegularExpressionLiteral,
17247
17275
  createLiteralLikeNode,
17248
17276
  createIdentifier,
17249
- updateIdentifier,
17250
17277
  createTempVariable,
17251
17278
  createLoopVariable,
17252
17279
  createUniqueName,
@@ -17989,55 +18016,43 @@ function createNodeFactory(flags, baseFactory2) {
17989
18016
  );
17990
18017
  }
17991
18018
  }
17992
- function createBaseIdentifier(escapedText, originalKeywordKind) {
18019
+ function createBaseIdentifier(escapedText) {
17993
18020
  const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
17994
- node.originalKeywordKind = originalKeywordKind;
17995
18021
  node.escapedText = escapedText;
17996
- node.autoGenerate = void 0;
17997
- node.typeArguments = void 0;
17998
- node.hasExtendedUnicodeEscape = void 0;
17999
18022
  node.jsDoc = void 0;
18000
- node.jsDocCache = void 0;
18001
18023
  node.flowNode = void 0;
18002
18024
  node.symbol = void 0;
18003
18025
  return node;
18004
18026
  }
18005
18027
  function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
18006
- const node = createBaseIdentifier(
18007
- escapeLeadingUnderscores(text),
18008
- /*originalKeywordKind*/
18009
- void 0
18010
- );
18011
- node.autoGenerate = {
18028
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text));
18029
+ setIdentifierAutoGenerate(node, {
18012
18030
  flags: autoGenerateFlags,
18013
18031
  id: nextAutoGenerateId,
18014
18032
  prefix,
18015
18033
  suffix
18016
- };
18034
+ });
18017
18035
  nextAutoGenerateId++;
18018
18036
  return node;
18019
18037
  }
18020
- function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
18038
+ function createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape) {
18021
18039
  if (originalKeywordKind === void 0 && text) {
18022
18040
  originalKeywordKind = stringToToken(text);
18023
18041
  }
18024
18042
  if (originalKeywordKind === 79 /* Identifier */) {
18025
18043
  originalKeywordKind = void 0;
18026
18044
  }
18027
- const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind);
18028
- node.typeArguments = asNodeArray(typeArguments);
18029
- node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
18030
- if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
18045
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text));
18046
+ if (hasExtendedUnicodeEscape)
18047
+ node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */;
18048
+ if (node.escapedText === "await") {
18031
18049
  node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
18032
18050
  }
18033
- if (node.hasExtendedUnicodeEscape) {
18051
+ if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) {
18034
18052
  node.transformFlags |= 1024 /* ContainsES2015 */;
18035
18053
  }
18036
18054
  return node;
18037
18055
  }
18038
- function updateIdentifier(node, typeArguments) {
18039
- return node.typeArguments !== typeArguments ? update(createIdentifier(idText(node), typeArguments), node) : node;
18040
- }
18041
18056
  function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) {
18042
18057
  let flags2 = 1 /* Auto */;
18043
18058
  if (reservedInNestedScopes)
@@ -18085,7 +18100,6 @@ function createNodeFactory(flags, baseFactory2) {
18085
18100
  function createBasePrivateIdentifier(escapedText) {
18086
18101
  const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
18087
18102
  node.escapedText = escapedText;
18088
- node.autoGenerate = void 0;
18089
18103
  node.transformFlags |= 16777216 /* ContainsClassFields */;
18090
18104
  return node;
18091
18105
  }
@@ -18096,12 +18110,12 @@ function createNodeFactory(flags, baseFactory2) {
18096
18110
  }
18097
18111
  function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
18098
18112
  const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
18099
- node.autoGenerate = {
18113
+ setIdentifierAutoGenerate(node, {
18100
18114
  flags: autoGenerateFlags,
18101
18115
  id: nextAutoGenerateId,
18102
18116
  prefix,
18103
18117
  suffix
18104
- };
18118
+ });
18105
18119
  nextAutoGenerateId++;
18106
18120
  return node;
18107
18121
  }
@@ -18263,7 +18277,6 @@ function createNodeFactory(flags, baseFactory2) {
18263
18277
  node.transformFlags = 1 /* ContainsTypeScript */;
18264
18278
  node.expression = void 0;
18265
18279
  node.jsDoc = void 0;
18266
- node.jsDocCache = void 0;
18267
18280
  return node;
18268
18281
  }
18269
18282
  function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) {
@@ -18284,7 +18297,6 @@ function createNodeFactory(flags, baseFactory2) {
18284
18297
  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 */);
18285
18298
  }
18286
18299
  node.jsDoc = void 0;
18287
- node.jsDocCache = void 0;
18288
18300
  return node;
18289
18301
  }
18290
18302
  function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
@@ -18312,7 +18324,6 @@ function createNodeFactory(flags, baseFactory2) {
18312
18324
  node.transformFlags = 1 /* ContainsTypeScript */;
18313
18325
  node.initializer = void 0;
18314
18326
  node.jsDoc = void 0;
18315
- node.jsDocCache = void 0;
18316
18327
  return node;
18317
18328
  }
18318
18329
  function updatePropertySignature(node, modifiers, name, questionToken, type) {
@@ -18335,7 +18346,6 @@ function createNodeFactory(flags, baseFactory2) {
18335
18346
  const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */;
18336
18347
  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 */;
18337
18348
  node.jsDoc = void 0;
18338
- node.jsDocCache = void 0;
18339
18349
  return node;
18340
18350
  }
18341
18351
  function updatePropertyDeclaration(node, modifiers, name, questionOrExclamationToken, type, initializer) {
@@ -18351,7 +18361,6 @@ function createNodeFactory(flags, baseFactory2) {
18351
18361
  node.type = type;
18352
18362
  node.transformFlags = 1 /* ContainsTypeScript */;
18353
18363
  node.jsDoc = void 0;
18354
- node.jsDocCache = void 0;
18355
18364
  node.locals = void 0;
18356
18365
  node.nextContainer = void 0;
18357
18366
  node.typeArguments = void 0;
@@ -18381,7 +18390,6 @@ function createNodeFactory(flags, baseFactory2) {
18381
18390
  }
18382
18391
  node.typeArguments = void 0;
18383
18392
  node.jsDoc = void 0;
18384
- node.jsDocCache = void 0;
18385
18393
  node.locals = void 0;
18386
18394
  node.nextContainer = void 0;
18387
18395
  node.flowNode = void 0;
@@ -18405,7 +18413,6 @@ function createNodeFactory(flags, baseFactory2) {
18405
18413
  node.illegalDecorators = void 0;
18406
18414
  node.modifiers = void 0;
18407
18415
  node.jsDoc = void 0;
18408
- node.jsDocCache = void 0;
18409
18416
  node.locals = void 0;
18410
18417
  node.nextContainer = void 0;
18411
18418
  node.endFlowNode = void 0;
@@ -18433,7 +18440,6 @@ function createNodeFactory(flags, baseFactory2) {
18433
18440
  node.type = void 0;
18434
18441
  node.typeArguments = void 0;
18435
18442
  node.jsDoc = void 0;
18436
- node.jsDocCache = void 0;
18437
18443
  node.locals = void 0;
18438
18444
  node.nextContainer = void 0;
18439
18445
  node.endFlowNode = void 0;
@@ -18466,7 +18472,6 @@ function createNodeFactory(flags, baseFactory2) {
18466
18472
  node.typeArguments = void 0;
18467
18473
  node.typeParameters = void 0;
18468
18474
  node.jsDoc = void 0;
18469
- node.jsDocCache = void 0;
18470
18475
  node.locals = void 0;
18471
18476
  node.nextContainer = void 0;
18472
18477
  node.flowNode = void 0;
@@ -18498,7 +18503,6 @@ function createNodeFactory(flags, baseFactory2) {
18498
18503
  node.typeParameters = void 0;
18499
18504
  node.type = void 0;
18500
18505
  node.jsDoc = void 0;
18501
- node.jsDocCache = void 0;
18502
18506
  node.locals = void 0;
18503
18507
  node.nextContainer = void 0;
18504
18508
  node.flowNode = void 0;
@@ -18523,7 +18527,6 @@ function createNodeFactory(flags, baseFactory2) {
18523
18527
  node.type = type;
18524
18528
  node.transformFlags = 1 /* ContainsTypeScript */;
18525
18529
  node.jsDoc = void 0;
18526
- node.jsDocCache = void 0;
18527
18530
  node.locals = void 0;
18528
18531
  node.nextContainer = void 0;
18529
18532
  node.typeArguments = void 0;
@@ -18539,7 +18542,6 @@ function createNodeFactory(flags, baseFactory2) {
18539
18542
  node.type = type;
18540
18543
  node.transformFlags = 1 /* ContainsTypeScript */;
18541
18544
  node.jsDoc = void 0;
18542
- node.jsDocCache = void 0;
18543
18545
  node.locals = void 0;
18544
18546
  node.nextContainer = void 0;
18545
18547
  node.typeArguments = void 0;
@@ -18556,7 +18558,6 @@ function createNodeFactory(flags, baseFactory2) {
18556
18558
  node.transformFlags = 1 /* ContainsTypeScript */;
18557
18559
  node.illegalDecorators = void 0;
18558
18560
  node.jsDoc = void 0;
18559
- node.jsDocCache = void 0;
18560
18561
  node.locals = void 0;
18561
18562
  node.nextContainer = void 0;
18562
18563
  node.typeArguments = void 0;
@@ -18607,7 +18608,6 @@ function createNodeFactory(flags, baseFactory2) {
18607
18608
  node.transformFlags = 1 /* ContainsTypeScript */;
18608
18609
  node.modifiers = void 0;
18609
18610
  node.jsDoc = void 0;
18610
- node.jsDocCache = void 0;
18611
18611
  node.locals = void 0;
18612
18612
  node.nextContainer = void 0;
18613
18613
  node.typeArguments = void 0;
@@ -18633,7 +18633,6 @@ function createNodeFactory(flags, baseFactory2) {
18633
18633
  node.type = type;
18634
18634
  node.transformFlags = 1 /* ContainsTypeScript */;
18635
18635
  node.jsDoc = void 0;
18636
- node.jsDocCache = void 0;
18637
18636
  node.locals = void 0;
18638
18637
  node.nextContainer = void 0;
18639
18638
  node.typeArguments = void 0;
@@ -18702,7 +18701,6 @@ function createNodeFactory(flags, baseFactory2) {
18702
18701
  node.type = type;
18703
18702
  node.transformFlags = 1 /* ContainsTypeScript */;
18704
18703
  node.jsDoc = void 0;
18705
- node.jsDocCache = void 0;
18706
18704
  return node;
18707
18705
  }
18708
18706
  function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) {
@@ -18904,7 +18902,6 @@ function createNodeFactory(flags, baseFactory2) {
18904
18902
  node.multiLine = multiLine;
18905
18903
  node.transformFlags |= propagateChildrenFlags(node.properties);
18906
18904
  node.jsDoc = void 0;
18907
- node.jsDocCache = void 0;
18908
18905
  return node;
18909
18906
  }
18910
18907
  function updateObjectLiteralExpression(node, properties) {
@@ -18917,7 +18914,6 @@ function createNodeFactory(flags, baseFactory2) {
18917
18914
  node.name = name;
18918
18915
  node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
18919
18916
  node.jsDoc = void 0;
18920
- node.jsDocCache = void 0;
18921
18917
  node.flowNode = void 0;
18922
18918
  return node;
18923
18919
  }
@@ -18968,7 +18964,6 @@ function createNodeFactory(flags, baseFactory2) {
18968
18964
  node.argumentExpression = argumentExpression;
18969
18965
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression);
18970
18966
  node.jsDoc = void 0;
18971
- node.jsDocCache = void 0;
18972
18967
  node.flowNode = void 0;
18973
18968
  return node;
18974
18969
  }
@@ -19119,7 +19114,6 @@ function createNodeFactory(flags, baseFactory2) {
19119
19114
  node.expression = expression;
19120
19115
  node.transformFlags = propagateChildFlags(node.expression);
19121
19116
  node.jsDoc = void 0;
19122
- node.jsDocCache = void 0;
19123
19117
  return node;
19124
19118
  }
19125
19119
  function updateParenthesizedExpression(node, expression) {
@@ -19140,7 +19134,6 @@ function createNodeFactory(flags, baseFactory2) {
19140
19134
  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 */;
19141
19135
  node.typeArguments = void 0;
19142
19136
  node.jsDoc = void 0;
19143
- node.jsDocCache = void 0;
19144
19137
  node.locals = void 0;
19145
19138
  node.nextContainer = void 0;
19146
19139
  node.flowNode = void 0;
@@ -19163,7 +19156,6 @@ function createNodeFactory(flags, baseFactory2) {
19163
19156
  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 */;
19164
19157
  node.typeArguments = void 0;
19165
19158
  node.jsDoc = void 0;
19166
- node.jsDocCache = void 0;
19167
19159
  node.locals = void 0;
19168
19160
  node.nextContainer = void 0;
19169
19161
  node.flowNode = void 0;
@@ -19261,7 +19253,6 @@ function createNodeFactory(flags, baseFactory2) {
19261
19253
  node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */;
19262
19254
  }
19263
19255
  node.jsDoc = void 0;
19264
- node.jsDocCache = void 0;
19265
19256
  return node;
19266
19257
  }
19267
19258
  function propagateAssignmentPatternFlags(node) {
@@ -19403,7 +19394,6 @@ function createNodeFactory(flags, baseFactory2) {
19403
19394
  node.members = createNodeArray(members);
19404
19395
  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 */;
19405
19396
  node.jsDoc = void 0;
19406
- node.jsDocCache = void 0;
19407
19397
  return node;
19408
19398
  }
19409
19399
  function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -19519,7 +19509,6 @@ function createNodeFactory(flags, baseFactory2) {
19519
19509
  node.multiLine = multiLine;
19520
19510
  node.transformFlags |= propagateChildrenFlags(node.statements);
19521
19511
  node.jsDoc = void 0;
19522
- node.jsDocCache = void 0;
19523
19512
  node.locals = void 0;
19524
19513
  node.nextContainer = void 0;
19525
19514
  return node;
@@ -19537,7 +19526,6 @@ function createNodeFactory(flags, baseFactory2) {
19537
19526
  }
19538
19527
  node.illegalDecorators = void 0;
19539
19528
  node.jsDoc = void 0;
19540
- node.jsDocCache = void 0;
19541
19529
  node.flowNode = void 0;
19542
19530
  return node;
19543
19531
  }
@@ -19547,7 +19535,6 @@ function createNodeFactory(flags, baseFactory2) {
19547
19535
  function createEmptyStatement() {
19548
19536
  const node = createBaseNode(239 /* EmptyStatement */);
19549
19537
  node.jsDoc = void 0;
19550
- node.jsDocCache = void 0;
19551
19538
  return node;
19552
19539
  }
19553
19540
  function createExpressionStatement(expression) {
@@ -19555,7 +19542,6 @@ function createNodeFactory(flags, baseFactory2) {
19555
19542
  node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
19556
19543
  node.transformFlags |= propagateChildFlags(node.expression);
19557
19544
  node.jsDoc = void 0;
19558
- node.jsDocCache = void 0;
19559
19545
  node.flowNode = void 0;
19560
19546
  return node;
19561
19547
  }
@@ -19569,7 +19555,6 @@ function createNodeFactory(flags, baseFactory2) {
19569
19555
  node.elseStatement = asEmbeddedStatement(elseStatement);
19570
19556
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement);
19571
19557
  node.jsDoc = void 0;
19572
- node.jsDocCache = void 0;
19573
19558
  node.flowNode = void 0;
19574
19559
  return node;
19575
19560
  }
@@ -19582,7 +19567,6 @@ function createNodeFactory(flags, baseFactory2) {
19582
19567
  node.expression = expression;
19583
19568
  node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
19584
19569
  node.jsDoc = void 0;
19585
- node.jsDocCache = void 0;
19586
19570
  node.flowNode = void 0;
19587
19571
  return node;
19588
19572
  }
@@ -19595,7 +19579,6 @@ function createNodeFactory(flags, baseFactory2) {
19595
19579
  node.statement = asEmbeddedStatement(statement);
19596
19580
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
19597
19581
  node.jsDoc = void 0;
19598
- node.jsDocCache = void 0;
19599
19582
  node.flowNode = void 0;
19600
19583
  return node;
19601
19584
  }
@@ -19610,7 +19593,6 @@ function createNodeFactory(flags, baseFactory2) {
19610
19593
  node.statement = asEmbeddedStatement(statement);
19611
19594
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement);
19612
19595
  node.jsDoc = void 0;
19613
- node.jsDocCache = void 0;
19614
19596
  node.locals = void 0;
19615
19597
  node.nextContainer = void 0;
19616
19598
  node.flowNode = void 0;
@@ -19626,7 +19608,6 @@ function createNodeFactory(flags, baseFactory2) {
19626
19608
  node.statement = asEmbeddedStatement(statement);
19627
19609
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
19628
19610
  node.jsDoc = void 0;
19629
- node.jsDocCache = void 0;
19630
19611
  node.locals = void 0;
19631
19612
  node.nextContainer = void 0;
19632
19613
  node.flowNode = void 0;
@@ -19645,7 +19626,6 @@ function createNodeFactory(flags, baseFactory2) {
19645
19626
  if (awaitModifier)
19646
19627
  node.transformFlags |= 128 /* ContainsES2018 */;
19647
19628
  node.jsDoc = void 0;
19648
- node.jsDocCache = void 0;
19649
19629
  node.locals = void 0;
19650
19630
  node.nextContainer = void 0;
19651
19631
  node.flowNode = void 0;
@@ -19659,7 +19639,6 @@ function createNodeFactory(flags, baseFactory2) {
19659
19639
  node.label = asName(label);
19660
19640
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
19661
19641
  node.jsDoc = void 0;
19662
- node.jsDocCache = void 0;
19663
19642
  node.flowNode = void 0;
19664
19643
  return node;
19665
19644
  }
@@ -19671,7 +19650,6 @@ function createNodeFactory(flags, baseFactory2) {
19671
19650
  node.label = asName(label);
19672
19651
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
19673
19652
  node.jsDoc = void 0;
19674
- node.jsDocCache = void 0;
19675
19653
  node.flowNode = void 0;
19676
19654
  return node;
19677
19655
  }
@@ -19683,7 +19661,6 @@ function createNodeFactory(flags, baseFactory2) {
19683
19661
  node.expression = expression;
19684
19662
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
19685
19663
  node.jsDoc = void 0;
19686
- node.jsDocCache = void 0;
19687
19664
  node.flowNode = void 0;
19688
19665
  return node;
19689
19666
  }
@@ -19696,7 +19673,6 @@ function createNodeFactory(flags, baseFactory2) {
19696
19673
  node.statement = asEmbeddedStatement(statement);
19697
19674
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
19698
19675
  node.jsDoc = void 0;
19699
- node.jsDocCache = void 0;
19700
19676
  node.flowNode = void 0;
19701
19677
  return node;
19702
19678
  }
@@ -19709,7 +19685,6 @@ function createNodeFactory(flags, baseFactory2) {
19709
19685
  node.caseBlock = caseBlock;
19710
19686
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
19711
19687
  node.jsDoc = void 0;
19712
- node.jsDocCache = void 0;
19713
19688
  node.flowNode = void 0;
19714
19689
  node.possiblyExhaustive = false;
19715
19690
  return node;
@@ -19723,7 +19698,6 @@ function createNodeFactory(flags, baseFactory2) {
19723
19698
  node.statement = asEmbeddedStatement(statement);
19724
19699
  node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
19725
19700
  node.jsDoc = void 0;
19726
- node.jsDocCache = void 0;
19727
19701
  node.flowNode = void 0;
19728
19702
  return node;
19729
19703
  }
@@ -19735,7 +19709,6 @@ function createNodeFactory(flags, baseFactory2) {
19735
19709
  node.expression = expression;
19736
19710
  node.transformFlags |= propagateChildFlags(node.expression);
19737
19711
  node.jsDoc = void 0;
19738
- node.jsDocCache = void 0;
19739
19712
  node.flowNode = void 0;
19740
19713
  return node;
19741
19714
  }
@@ -19749,7 +19722,6 @@ function createNodeFactory(flags, baseFactory2) {
19749
19722
  node.finallyBlock = finallyBlock;
19750
19723
  node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock);
19751
19724
  node.jsDoc = void 0;
19752
- node.jsDocCache = void 0;
19753
19725
  node.flowNode = void 0;
19754
19726
  return node;
19755
19727
  }
@@ -19759,7 +19731,6 @@ function createNodeFactory(flags, baseFactory2) {
19759
19731
  function createDebuggerStatement() {
19760
19732
  const node = createBaseNode(256 /* DebuggerStatement */);
19761
19733
  node.jsDoc = void 0;
19762
- node.jsDocCache = void 0;
19763
19734
  node.flowNode = void 0;
19764
19735
  return node;
19765
19736
  }
@@ -19772,7 +19743,6 @@ function createNodeFactory(flags, baseFactory2) {
19772
19743
  node.initializer = asInitializer(initializer);
19773
19744
  node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */);
19774
19745
  node.jsDoc = void 0;
19775
- node.jsDocCache = void 0;
19776
19746
  return node;
19777
19747
  }
19778
19748
  function updateVariableDeclaration(node, name, exclamationToken, type, initializer) {
@@ -19811,7 +19781,6 @@ function createNodeFactory(flags, baseFactory2) {
19811
19781
  node.illegalDecorators = void 0;
19812
19782
  node.typeArguments = void 0;
19813
19783
  node.jsDoc = void 0;
19814
- node.jsDocCache = void 0;
19815
19784
  node.locals = void 0;
19816
19785
  node.nextContainer = void 0;
19817
19786
  node.endFlowNode = void 0;
@@ -19843,7 +19812,6 @@ function createNodeFactory(flags, baseFactory2) {
19843
19812
  }
19844
19813
  }
19845
19814
  node.jsDoc = void 0;
19846
- node.jsDocCache = void 0;
19847
19815
  return node;
19848
19816
  }
19849
19817
  function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -19859,7 +19827,6 @@ function createNodeFactory(flags, baseFactory2) {
19859
19827
  node.transformFlags = 1 /* ContainsTypeScript */;
19860
19828
  node.illegalDecorators = void 0;
19861
19829
  node.jsDoc = void 0;
19862
- node.jsDocCache = void 0;
19863
19830
  return node;
19864
19831
  }
19865
19832
  function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -19880,7 +19847,6 @@ function createNodeFactory(flags, baseFactory2) {
19880
19847
  node.transformFlags = 1 /* ContainsTypeScript */;
19881
19848
  node.illegalDecorators = void 0;
19882
19849
  node.jsDoc = void 0;
19883
- node.jsDocCache = void 0;
19884
19850
  node.locals = void 0;
19885
19851
  node.nextContainer = void 0;
19886
19852
  return node;
@@ -19903,7 +19869,6 @@ function createNodeFactory(flags, baseFactory2) {
19903
19869
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
19904
19870
  node.illegalDecorators = void 0;
19905
19871
  node.jsDoc = void 0;
19906
- node.jsDocCache = void 0;
19907
19872
  return node;
19908
19873
  }
19909
19874
  function updateEnumDeclaration(node, modifiers, name, members) {
@@ -19929,7 +19894,6 @@ function createNodeFactory(flags, baseFactory2) {
19929
19894
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
19930
19895
  node.illegalDecorators = void 0;
19931
19896
  node.jsDoc = void 0;
19932
- node.jsDocCache = void 0;
19933
19897
  node.locals = void 0;
19934
19898
  node.nextContainer = void 0;
19935
19899
  return node;
@@ -19948,7 +19912,6 @@ function createNodeFactory(flags, baseFactory2) {
19948
19912
  node.statements = createNodeArray(statements);
19949
19913
  node.transformFlags |= propagateChildrenFlags(node.statements);
19950
19914
  node.jsDoc = void 0;
19951
- node.jsDocCache = void 0;
19952
19915
  return node;
19953
19916
  }
19954
19917
  function updateModuleBlock(node, statements) {
@@ -19972,7 +19935,6 @@ function createNodeFactory(flags, baseFactory2) {
19972
19935
  node.illegalDecorators = void 0;
19973
19936
  node.modifiers = void 0;
19974
19937
  node.jsDoc = void 0;
19975
- node.jsDocCache = void 0;
19976
19938
  return node;
19977
19939
  }
19978
19940
  function updateNamespaceExportDeclaration(node, name) {
@@ -19998,7 +19960,6 @@ function createNodeFactory(flags, baseFactory2) {
19998
19960
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
19999
19961
  node.illegalDecorators = void 0;
20000
19962
  node.jsDoc = void 0;
20001
- node.jsDocCache = void 0;
20002
19963
  return node;
20003
19964
  }
20004
19965
  function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
@@ -20020,7 +19981,6 @@ function createNodeFactory(flags, baseFactory2) {
20020
19981
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20021
19982
  node.illegalDecorators = void 0;
20022
19983
  node.jsDoc = void 0;
20023
- node.jsDocCache = void 0;
20024
19984
  return node;
20025
19985
  }
20026
19986
  function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) {
@@ -20132,7 +20092,6 @@ function createNodeFactory(flags, baseFactory2) {
20132
20092
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20133
20093
  node.illegalDecorators = void 0;
20134
20094
  node.jsDoc = void 0;
20135
- node.jsDocCache = void 0;
20136
20095
  return node;
20137
20096
  }
20138
20097
  function updateExportAssignment(node, modifiers, expression) {
@@ -20155,7 +20114,6 @@ function createNodeFactory(flags, baseFactory2) {
20155
20114
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20156
20115
  node.illegalDecorators = void 0;
20157
20116
  node.jsDoc = void 0;
20158
- node.jsDocCache = void 0;
20159
20117
  return node;
20160
20118
  }
20161
20119
  function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
@@ -20185,7 +20143,6 @@ function createNodeFactory(flags, baseFactory2) {
20185
20143
  node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name);
20186
20144
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20187
20145
  node.jsDoc = void 0;
20188
- node.jsDocCache = void 0;
20189
20146
  return node;
20190
20147
  }
20191
20148
  function updateExportSpecifier(node, isTypeOnly, propertyName, name) {
@@ -20194,7 +20151,6 @@ function createNodeFactory(flags, baseFactory2) {
20194
20151
  function createMissingDeclaration() {
20195
20152
  const node = createBaseDeclaration(279 /* MissingDeclaration */);
20196
20153
  node.jsDoc = void 0;
20197
- node.jsDocCache = void 0;
20198
20154
  return node;
20199
20155
  }
20200
20156
  function createExternalModuleReference(expression) {
@@ -20235,7 +20191,6 @@ function createNodeFactory(flags, baseFactory2) {
20235
20191
  node.type = type;
20236
20192
  node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
20237
20193
  node.jsDoc = void 0;
20238
- node.jsDocCache = void 0;
20239
20194
  node.locals = void 0;
20240
20195
  node.nextContainer = void 0;
20241
20196
  node.typeArguments = void 0;
@@ -20267,7 +20222,6 @@ function createNodeFactory(flags, baseFactory2) {
20267
20222
  node.parameters = createNodeArray(parameters);
20268
20223
  node.type = type;
20269
20224
  node.jsDoc = void 0;
20270
- node.jsDocCache = void 0;
20271
20225
  node.locals = void 0;
20272
20226
  node.nextContainer = void 0;
20273
20227
  return node;
@@ -20595,7 +20549,6 @@ function createNodeFactory(flags, baseFactory2) {
20595
20549
  node.statements = createNodeArray(statements);
20596
20550
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
20597
20551
  node.jsDoc = void 0;
20598
- node.jsDocCache = void 0;
20599
20552
  return node;
20600
20553
  }
20601
20554
  function updateCaseClause(node, expression, statements) {
@@ -20652,7 +20605,6 @@ function createNodeFactory(flags, baseFactory2) {
20652
20605
  node.questionToken = void 0;
20653
20606
  node.exclamationToken = void 0;
20654
20607
  node.jsDoc = void 0;
20655
- node.jsDocCache = void 0;
20656
20608
  return node;
20657
20609
  }
20658
20610
  function updatePropertyAssignment(node, name, initializer) {
@@ -20678,7 +20630,6 @@ function createNodeFactory(flags, baseFactory2) {
20678
20630
  node.questionToken = void 0;
20679
20631
  node.exclamationToken = void 0;
20680
20632
  node.jsDoc = void 0;
20681
- node.jsDocCache = void 0;
20682
20633
  return node;
20683
20634
  }
20684
20635
  function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) {
@@ -20699,7 +20650,6 @@ function createNodeFactory(flags, baseFactory2) {
20699
20650
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
20700
20651
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
20701
20652
  node.jsDoc = void 0;
20702
- node.jsDocCache = void 0;
20703
20653
  return node;
20704
20654
  }
20705
20655
  function updateSpreadAssignment(node, expression) {
@@ -20711,7 +20661,6 @@ function createNodeFactory(flags, baseFactory2) {
20711
20661
  node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
20712
20662
  node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
20713
20663
  node.jsDoc = void 0;
20714
- node.jsDocCache = void 0;
20715
20664
  return node;
20716
20665
  }
20717
20666
  function updateEnumMember(node, name, initializer) {
@@ -20957,36 +20906,32 @@ function createNodeFactory(flags, baseFactory2) {
20957
20906
  return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node;
20958
20907
  }
20959
20908
  function cloneGeneratedIdentifier(node) {
20960
- const clone2 = createBaseIdentifier(
20961
- node.escapedText,
20962
- /*originalKeywordKind*/
20963
- void 0
20964
- );
20909
+ const clone2 = createBaseIdentifier(node.escapedText);
20965
20910
  clone2.flags |= node.flags & ~8 /* Synthesized */;
20966
- clone2.autoGenerate = { ...node.autoGenerate };
20967
20911
  clone2.transformFlags = node.transformFlags;
20968
20912
  setOriginalNode(clone2, node);
20913
+ setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
20969
20914
  return clone2;
20970
20915
  }
20971
20916
  function cloneIdentifier(node) {
20972
- const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind);
20917
+ const clone2 = createBaseIdentifier(node.escapedText);
20973
20918
  clone2.flags |= node.flags & ~8 /* Synthesized */;
20974
- clone2.typeArguments = node.typeArguments;
20975
- clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape;
20976
20919
  clone2.jsDoc = node.jsDoc;
20977
- clone2.jsDocCache = node.jsDocCache;
20978
20920
  clone2.flowNode = node.flowNode;
20979
20921
  clone2.symbol = node.symbol;
20980
20922
  clone2.transformFlags = node.transformFlags;
20981
20923
  setOriginalNode(clone2, node);
20924
+ const typeArguments = getIdentifierTypeArguments(node);
20925
+ if (typeArguments)
20926
+ setIdentifierTypeArguments(clone2, typeArguments);
20982
20927
  return clone2;
20983
20928
  }
20984
20929
  function cloneGeneratedPrivateIdentifier(node) {
20985
20930
  const clone2 = createBasePrivateIdentifier(node.escapedText);
20986
20931
  clone2.flags |= node.flags & ~8 /* Synthesized */;
20987
- clone2.autoGenerate = { ...node.autoGenerate };
20988
20932
  clone2.transformFlags = node.transformFlags;
20989
20933
  setOriginalNode(clone2, node);
20934
+ setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
20990
20935
  return clone2;
20991
20936
  }
20992
20937
  function clonePrivateIdentifier(node) {
@@ -22194,6 +22139,26 @@ function getTypeNode(node) {
22194
22139
  var _a2;
22195
22140
  return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode;
22196
22141
  }
22142
+ function setIdentifierTypeArguments(node, typeArguments) {
22143
+ getOrCreateEmitNode(node).identifierTypeArguments = typeArguments;
22144
+ return node;
22145
+ }
22146
+ function getIdentifierTypeArguments(node) {
22147
+ var _a2;
22148
+ return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments;
22149
+ }
22150
+ function setIdentifierAutoGenerate(node, autoGenerate) {
22151
+ getOrCreateEmitNode(node).autoGenerate = autoGenerate;
22152
+ return node;
22153
+ }
22154
+ function setIdentifierGeneratedImportReference(node, value) {
22155
+ getOrCreateEmitNode(node).generatedImportReference = value;
22156
+ return node;
22157
+ }
22158
+ function getIdentifierGeneratedImportReference(node) {
22159
+ var _a2;
22160
+ return (_a2 = node.emitNode) == null ? void 0 : _a2.generatedImportReference;
22161
+ }
22197
22162
 
22198
22163
  // src/compiler/factory/emitHelpers.ts
22199
22164
  function createEmitHelperFactory(context) {
@@ -24420,13 +24385,16 @@ function elideNodes(factory2, nodes) {
24420
24385
  return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes);
24421
24386
  }
24422
24387
  function getNodeForGeneratedName(name) {
24423
- if (name.autoGenerate.flags & 4 /* Node */) {
24424
- const autoGenerateId = name.autoGenerate.id;
24388
+ var _a2;
24389
+ const autoGenerate = name.emitNode.autoGenerate;
24390
+ if (autoGenerate.flags & 4 /* Node */) {
24391
+ const autoGenerateId = autoGenerate.id;
24425
24392
  let node = name;
24426
24393
  let original = node.original;
24427
24394
  while (original) {
24428
24395
  node = original;
24429
- if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) {
24396
+ const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate;
24397
+ if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) {
24430
24398
  break;
24431
24399
  }
24432
24400
  original = node.original;
@@ -26025,8 +25993,6 @@ var Parser;
26025
25993
  const pos = getNodePos();
26026
25994
  const result = kind === 79 /* Identifier */ ? factory2.createIdentifier(
26027
25995
  "",
26028
- /*typeArguments*/
26029
- void 0,
26030
25996
  /*originalKeywordKind*/
26031
25997
  void 0
26032
25998
  ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(
@@ -26061,13 +26027,7 @@ var Parser;
26061
26027
  const text = internIdentifier(scanner.getTokenValue());
26062
26028
  const hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
26063
26029
  nextTokenWithoutCheck();
26064
- return finishNode(factory2.createIdentifier(
26065
- text,
26066
- /*typeArguments*/
26067
- void 0,
26068
- originalKeywordKind,
26069
- hasExtendedUnicodeEscape
26070
- ), pos);
26030
+ return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos);
26071
26031
  }
26072
26032
  if (token() === 80 /* PrivateIdentifier */) {
26073
26033
  parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
@@ -26409,6 +26369,7 @@ var Parser;
26409
26369
  return parseElement();
26410
26370
  }
26411
26371
  function currentNode(parsingContext2, pos) {
26372
+ var _a2;
26412
26373
  if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) {
26413
26374
  return void 0;
26414
26375
  }
@@ -26423,8 +26384,8 @@ var Parser;
26423
26384
  if (!canReuseNode(node, parsingContext2)) {
26424
26385
  return void 0;
26425
26386
  }
26426
- if (canHaveJSDoc(node) && node.jsDocCache) {
26427
- node.jsDocCache = void 0;
26387
+ if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) {
26388
+ node.jsDoc.jsDocCache = void 0;
26428
26389
  }
26429
26390
  return node;
26430
26391
  }
@@ -26483,7 +26444,7 @@ var Parser;
26483
26444
  return true;
26484
26445
  case 171 /* MethodDeclaration */:
26485
26446
  const methodDeclaration = node;
26486
- const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 135 /* ConstructorKeyword */;
26447
+ const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.escapedText === "constructor";
26487
26448
  return !nameIsConstructor;
26488
26449
  }
26489
26450
  }
@@ -26705,13 +26666,10 @@ var Parser;
26705
26666
  function parseEntityName(allowReservedWords, diagnosticMessage) {
26706
26667
  const pos = getNodePos();
26707
26668
  let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
26708
- let dotPos = getNodePos();
26709
26669
  while (parseOptional(24 /* DotToken */)) {
26710
26670
  if (token() === 29 /* LessThanToken */) {
26711
- entity.jsdocDotPos = dotPos;
26712
26671
  break;
26713
26672
  }
26714
- dotPos = getNodePos();
26715
26673
  entity = finishNode(
26716
26674
  factory2.createQualifiedName(
26717
26675
  entity,
@@ -31491,7 +31449,7 @@ var Parser;
31491
31449
  return finishNode(jsDocNamespaceNode, pos);
31492
31450
  }
31493
31451
  if (nested) {
31494
- typeNameOrNamespaceName.isInJSDocNamespace = true;
31452
+ typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */;
31495
31453
  }
31496
31454
  return typeNameOrNamespaceName;
31497
31455
  }
@@ -31695,12 +31653,7 @@ var Parser;
31695
31653
  const end2 = scanner.getTextPos();
31696
31654
  const originalKeywordKind = token();
31697
31655
  const text = internIdentifier(scanner.getTokenValue());
31698
- const result = finishNode(factory2.createIdentifier(
31699
- text,
31700
- /*typeArguments*/
31701
- void 0,
31702
- originalKeywordKind
31703
- ), pos, end2);
31656
+ const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2);
31704
31657
  nextTokenJSDoc();
31705
31658
  return result;
31706
31659
  }
@@ -34297,7 +34250,8 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
34297
34250
  if (returnValue) {
34298
34251
  result[keyText] = value;
34299
34252
  }
34300
- if (jsonConversionNotifier && (parentOption || isRootOptionMap(knownOptions))) {
34253
+ if (jsonConversionNotifier && // Current callbacks are only on known parent option or if we are setting values in the root
34254
+ (parentOption || isRootOptionMap(knownOptions))) {
34301
34255
  const isValidOptionValue = isCompilerOptionsValue(option, value);
34302
34256
  if (parentOption) {
34303
34257
  if (isValidOptionValue) {
@@ -35559,7 +35513,7 @@ function resolvedTypeScriptOnly(resolved) {
35559
35513
  Debug.assert(extensionIsTS(resolved.extension));
35560
35514
  return { fileName: resolved.path, packageId: resolved.packageId };
35561
35515
  }
35562
- function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) {
35516
+ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
35563
35517
  if (resultFromCache) {
35564
35518
  resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
35565
35519
  resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations);
@@ -35577,7 +35531,8 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra
35577
35531
  },
35578
35532
  failedLookupLocations: initializeResolutionField(failedLookupLocations),
35579
35533
  affectingLocations: initializeResolutionField(affectingLocations),
35580
- resolutionDiagnostics: initializeResolutionField(diagnostics)
35534
+ resolutionDiagnostics: initializeResolutionField(diagnostics),
35535
+ node10Result: legacyResult
35581
35536
  };
35582
35537
  }
35583
35538
  function initializeResolutionField(value) {
@@ -36607,7 +36562,7 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
36607
36562
  );
36608
36563
  }
36609
36564
  function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
36610
- var _a2, _b;
36565
+ var _a2, _b, _c, _d;
36611
36566
  const traceEnabled = isTraceEnabled(compilerOptions, host);
36612
36567
  const failedLookupLocations = [];
36613
36568
  const affectingLocations = [];
@@ -36634,44 +36589,60 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
36634
36589
  if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) {
36635
36590
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
36636
36591
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
36637
- result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
36592
+ result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
36638
36593
  } else {
36639
- result = tryResolve(extensions);
36594
+ result = tryResolve(extensions, state);
36595
+ }
36596
+ let legacyResult;
36597
+ 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) {
36598
+ traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
36599
+ const diagnosticState = {
36600
+ ...state,
36601
+ features: state.features & ~8 /* Exports */,
36602
+ failedLookupLocations: [],
36603
+ affectingLocations: [],
36604
+ reportDiagnostic: noop
36605
+ };
36606
+ const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
36607
+ if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
36608
+ legacyResult = diagnosticResult.value.resolved.path;
36609
+ }
36640
36610
  }
36641
36611
  return createResolvedModuleWithFailedLookupLocations(
36642
- (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved,
36643
- (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport,
36612
+ (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
36613
+ (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
36644
36614
  failedLookupLocations,
36645
36615
  affectingLocations,
36646
36616
  diagnostics,
36647
- state.resultFromCache
36617
+ state.resultFromCache,
36618
+ legacyResult
36648
36619
  );
36649
- function tryResolve(extensions2) {
36650
- const loader = (extensions3, candidate, onlyRecordFailures, state2) => nodeLoadModuleByRelativeName(
36620
+ function tryResolve(extensions2, state2) {
36621
+ const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName(
36651
36622
  extensions3,
36652
36623
  candidate,
36653
36624
  onlyRecordFailures,
36654
- state2,
36625
+ state3,
36655
36626
  /*considerPackageJson*/
36656
36627
  true
36657
36628
  );
36658
- const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state);
36629
+ const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2);
36659
36630
  if (resolved) {
36660
36631
  return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
36661
36632
  }
36662
36633
  if (!isExternalModuleNameRelative(moduleName)) {
36663
36634
  let resolved2;
36664
36635
  if (features & 2 /* Imports */ && startsWith(moduleName, "#")) {
36665
- resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
36636
+ resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
36666
36637
  }
36667
36638
  if (!resolved2 && features & 4 /* SelfName */) {
36668
- resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
36639
+ resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
36669
36640
  }
36670
36641
  if (!resolved2) {
36671
36642
  if (traceEnabled) {
36672
36643
  trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
36673
36644
  }
36674
- resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
36645
+ resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
36675
36646
  }
36676
36647
  if (!resolved2)
36677
36648
  return void 0;
@@ -36690,7 +36661,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
36690
36661
  candidate,
36691
36662
  /*onlyRecordFailures*/
36692
36663
  false,
36693
- state,
36664
+ state2,
36694
36665
  /*considerPackageJson*/
36695
36666
  true
36696
36667
  );
@@ -37923,7 +37894,7 @@ function getModuleInstanceStateWorker(node, visited) {
37923
37894
  case 264 /* ModuleDeclaration */:
37924
37895
  return getModuleInstanceState(node, visited);
37925
37896
  case 79 /* Identifier */:
37926
- if (node.isInJSDocNamespace) {
37897
+ if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
37927
37898
  return 0 /* NonInstantiated */;
37928
37899
  }
37929
37900
  }
@@ -38360,6 +38331,7 @@ function createBinder() {
38360
38331
  } else if (containerFlags & 64 /* IsInterface */) {
38361
38332
  seenThisKeyword = false;
38362
38333
  bindChildren(node);
38334
+ Debug.assertNotNode(node, isIdentifier);
38363
38335
  node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */;
38364
38336
  } else {
38365
38337
  bindChildren(node);
@@ -39519,13 +39491,14 @@ function createBinder() {
39519
39491
  }
39520
39492
  function checkContextualIdentifier(node) {
39521
39493
  if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) {
39522
- if (inStrictMode && node.originalKeywordKind >= 117 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 125 /* LastFutureReservedWord */) {
39494
+ const originalKeywordKind = identifierToKeywordKind(node);
39495
+ if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) {
39523
39496
  file.bindDiagnostics.push(createDiagnosticForNode2(
39524
39497
  node,
39525
39498
  getStrictModeIdentifierMessage(node),
39526
39499
  declarationNameToString(node)
39527
39500
  ));
39528
- } else if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
39501
+ } else if (originalKeywordKind === 133 /* AwaitKeyword */) {
39529
39502
  if (isExternalModule(file) && isInTopLevelContext(node)) {
39530
39503
  file.bindDiagnostics.push(createDiagnosticForNode2(
39531
39504
  node,
@@ -39539,7 +39512,7 @@ function createBinder() {
39539
39512
  declarationNameToString(node)
39540
39513
  ));
39541
39514
  }
39542
- } else if (node.originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {
39515
+ } else if (originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {
39543
39516
  file.bindDiagnostics.push(createDiagnosticForNode2(
39544
39517
  node,
39545
39518
  Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,
@@ -39751,7 +39724,7 @@ function createBinder() {
39751
39724
  function bindWorker(node) {
39752
39725
  switch (node.kind) {
39753
39726
  case 79 /* Identifier */:
39754
- if (node.isInJSDocNamespace) {
39727
+ if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
39755
39728
  let parentNode = node.parent;
39756
39729
  while (parentNode && !isJSDocTypeAlias(parentNode)) {
39757
39730
  parentNode = parentNode.parent;
@@ -40575,8 +40548,12 @@ function createBinder() {
40575
40548
  return false;
40576
40549
  }
40577
40550
  if (currentFlow === unreachableFlow) {
40578
- const reportError = isStatementButNotDeclaration(node) && node.kind !== 239 /* EmptyStatement */ || // report error on class declarations
40579
- node.kind === 260 /* ClassDeclaration */ || node.kind === 264 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
40551
+ const reportError = (
40552
+ // report error on all statements except empty ones
40553
+ isStatementButNotDeclaration(node) && node.kind !== 239 /* EmptyStatement */ || // report error on class declarations
40554
+ node.kind === 260 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set
40555
+ node.kind === 264 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)
40556
+ );
40580
40557
  if (reportError) {
40581
40558
  currentFlow = reportedUnreachableFlow;
40582
40559
  if (!options.allowUnreachableCode) {
@@ -44761,6 +44738,8 @@ function createTypeChecker(host) {
44761
44738
  /*isError*/
44762
44739
  false,
44763
44740
  errorNode,
44741
+ currentSourceFile,
44742
+ mode,
44764
44743
  resolvedModule,
44765
44744
  moduleReference
44766
44745
  );
@@ -44846,6 +44825,8 @@ function createTypeChecker(host) {
44846
44825
  /*isError*/
44847
44826
  noImplicitAny && !!moduleNotFoundError,
44848
44827
  errorNode,
44828
+ currentSourceFile,
44829
+ mode,
44849
44830
  resolvedModule,
44850
44831
  moduleReference
44851
44832
  );
@@ -44900,26 +44881,37 @@ function createTypeChecker(host) {
44900
44881
  return importSourceWithoutExtension;
44901
44882
  }
44902
44883
  }
44903
- function errorOnImplicitAnyModule(isError, errorNode, { packageId, resolvedFileName }, moduleReference) {
44904
- const errorInfo = !isExternalModuleNameRelative(moduleReference) && packageId ? typesPackageExists(packageId.name) ? chainDiagnosticMessages(
44905
- /*details*/
44906
- void 0,
44907
- 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,
44908
- packageId.name,
44909
- mangleScopedPackageName(packageId.name)
44910
- ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages(
44911
- /*details*/
44912
- void 0,
44913
- Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,
44914
- packageId.name,
44915
- moduleReference
44916
- ) : chainDiagnosticMessages(
44917
- /*details*/
44918
- void 0,
44919
- Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
44920
- moduleReference,
44921
- mangleScopedPackageName(packageId.name)
44922
- ) : void 0;
44884
+ function errorOnImplicitAnyModule(isError, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) {
44885
+ var _a2, _b;
44886
+ let errorInfo;
44887
+ if (!isExternalModuleNameRelative(moduleReference) && packageId) {
44888
+ const node10Result = (_b = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleReference, mode)) == null ? void 0 : _b.node10Result;
44889
+ errorInfo = node10Result ? chainDiagnosticMessages(
44890
+ /*details*/
44891
+ void 0,
44892
+ 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,
44893
+ node10Result,
44894
+ node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageId.name)}` : packageId.name
44895
+ ) : typesPackageExists(packageId.name) ? chainDiagnosticMessages(
44896
+ /*details*/
44897
+ void 0,
44898
+ 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,
44899
+ packageId.name,
44900
+ mangleScopedPackageName(packageId.name)
44901
+ ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages(
44902
+ /*details*/
44903
+ void 0,
44904
+ Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,
44905
+ packageId.name,
44906
+ moduleReference
44907
+ ) : chainDiagnosticMessages(
44908
+ /*details*/
44909
+ void 0,
44910
+ Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
44911
+ moduleReference,
44912
+ mangleScopedPackageName(packageId.name)
44913
+ );
44914
+ }
44923
44915
  errorOrSuggestion(isError, errorNode, chainDiagnosticMessages(
44924
44916
  errorInfo,
44925
44917
  Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,
@@ -46382,7 +46374,8 @@ function createTypeChecker(host) {
46382
46374
  const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
46383
46375
  forEach(symbol.declarations, (declaration) => declaration.parent.kind === 308 /* SourceFile */ || declaration.parent.kind === 265 /* ModuleBlock */));
46384
46376
  if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
46385
- return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a4 = context.visitedTypes) == null ? void 0 : _a4.has(typeId))) && (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
46377
+ return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a4 = context.visitedTypes) == null ? void 0 : _a4.has(typeId))) && // it is type of the symbol uses itself recursively
46378
+ (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
46386
46379
  }
46387
46380
  }
46388
46381
  }
@@ -46474,7 +46467,9 @@ function createTypeChecker(host) {
46474
46467
  const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
46475
46468
  if (some(abstractSignatures)) {
46476
46469
  const types = map(abstractSignatures, getOrCreateTypeFromSignature);
46477
- 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));
46470
+ 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
46471
+ // the logic in `createTypeNodesFromResolvedType`.
46472
+ (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
46478
46473
  if (typeElementCount) {
46479
46474
  types.push(getResolvedTypeWithoutAbstractConstructSignatures(resolved));
46480
46475
  }
@@ -46573,13 +46568,17 @@ function createTypeChecker(host) {
46573
46568
  let qualifier = root.qualifier;
46574
46569
  if (qualifier) {
46575
46570
  if (isIdentifier(qualifier)) {
46576
- qualifier = factory.updateIdentifier(qualifier, typeArguments);
46571
+ if (typeArguments !== getIdentifierTypeArguments(qualifier)) {
46572
+ qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments);
46573
+ }
46577
46574
  } else {
46578
- qualifier = factory.updateQualifiedName(
46579
- qualifier,
46580
- qualifier.left,
46581
- factory.updateIdentifier(qualifier.right, typeArguments)
46582
- );
46575
+ if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) {
46576
+ qualifier = factory.updateQualifiedName(
46577
+ qualifier,
46578
+ qualifier.left,
46579
+ setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments)
46580
+ );
46581
+ }
46583
46582
  }
46584
46583
  }
46585
46584
  typeArguments = ref.typeArguments;
@@ -46599,13 +46598,17 @@ function createTypeChecker(host) {
46599
46598
  let typeArguments = root.typeArguments;
46600
46599
  let typeName = root.typeName;
46601
46600
  if (isIdentifier(typeName)) {
46602
- typeName = factory.updateIdentifier(typeName, typeArguments);
46601
+ if (typeArguments !== getIdentifierTypeArguments(typeName)) {
46602
+ typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments);
46603
+ }
46603
46604
  } else {
46604
- typeName = factory.updateQualifiedName(
46605
- typeName,
46606
- typeName.left,
46607
- factory.updateIdentifier(typeName.right, typeArguments)
46608
- );
46605
+ if (typeArguments !== getIdentifierTypeArguments(typeName.right)) {
46606
+ typeName = factory.updateQualifiedName(
46607
+ typeName,
46608
+ typeName.left,
46609
+ setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments)
46610
+ );
46611
+ }
46609
46612
  }
46610
46613
  typeArguments = ref.typeArguments;
46611
46614
  const ids = getAccessStack(ref);
@@ -47136,9 +47139,11 @@ function createTypeChecker(host) {
47136
47139
  if (accessibleSymbolChain) {
47137
47140
  return accessibleSymbolChain;
47138
47141
  }
47139
- if (// If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
47140
- endOfChain || // If a parent symbol is an anonymous type, don't write it.
47141
- !(symbol2.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) {
47142
+ if (
47143
+ // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
47144
+ endOfChain || // If a parent symbol is an anonymous type, don't write it.
47145
+ !(symbol2.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))
47146
+ ) {
47142
47147
  if (!endOfChain && !yieldModuleSymbol && !!forEach(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
47143
47148
  return;
47144
47149
  }
@@ -47317,7 +47322,11 @@ function createTypeChecker(host) {
47317
47322
  if (!nonRootParts || isEntityName(nonRootParts)) {
47318
47323
  if (nonRootParts) {
47319
47324
  const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right;
47320
- lastId.typeArguments = void 0;
47325
+ setIdentifierTypeArguments(
47326
+ lastId,
47327
+ /*typeArguments*/
47328
+ void 0
47329
+ );
47321
47330
  }
47322
47331
  return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf);
47323
47332
  } else {
@@ -47334,8 +47343,12 @@ function createTypeChecker(host) {
47334
47343
  return factory.createTypeQueryNode(entityName);
47335
47344
  } else {
47336
47345
  const lastId = isIdentifier(entityName) ? entityName : entityName.right;
47337
- const lastTypeArgs = lastId.typeArguments;
47338
- lastId.typeArguments = void 0;
47346
+ const lastTypeArgs = getIdentifierTypeArguments(lastId);
47347
+ setIdentifierTypeArguments(
47348
+ lastId,
47349
+ /*typeArguments*/
47350
+ void 0
47351
+ );
47339
47352
  return factory.createTypeReferenceNode(entityName, lastTypeArgs);
47340
47353
  }
47341
47354
  function createAccessFromSymbolChain(chain2, index, stopper) {
@@ -47379,7 +47392,9 @@ function createTypeChecker(host) {
47379
47392
  return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2)));
47380
47393
  }
47381
47394
  }
47382
- const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
47395
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
47396
+ if (typeParameterNodes)
47397
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
47383
47398
  identifier.symbol = symbol2;
47384
47399
  if (index > stopper) {
47385
47400
  const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper);
@@ -47437,7 +47452,9 @@ function createTypeChecker(host) {
47437
47452
  text = `${rawtext}_${i}`;
47438
47453
  }
47439
47454
  if (text !== rawtext) {
47440
- result = factory.createIdentifier(text, result.typeArguments);
47455
+ const typeArguments = getIdentifierTypeArguments(result);
47456
+ result = factory.createIdentifier(text);
47457
+ setIdentifierTypeArguments(result, typeArguments);
47441
47458
  }
47442
47459
  (context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
47443
47460
  (context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
@@ -47461,7 +47478,9 @@ function createTypeChecker(host) {
47461
47478
  if (index === 0) {
47462
47479
  context.flags ^= 16777216 /* InInitialEntityName */;
47463
47480
  }
47464
- const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
47481
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
47482
+ if (typeParameterNodes)
47483
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
47465
47484
  identifier.symbol = symbol2;
47466
47485
  return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier;
47467
47486
  }
@@ -47484,7 +47503,9 @@ function createTypeChecker(host) {
47484
47503
  return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context));
47485
47504
  }
47486
47505
  if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) {
47487
- const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
47506
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
47507
+ if (typeParameterNodes)
47508
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
47488
47509
  identifier.symbol = symbol2;
47489
47510
  return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier;
47490
47511
  } else {
@@ -47499,8 +47520,11 @@ function createTypeChecker(host) {
47499
47520
  expression = factory.createNumericLiteral(+symbolName2);
47500
47521
  }
47501
47522
  if (!expression) {
47502
- expression = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
47503
- expression.symbol = symbol2;
47523
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
47524
+ if (typeParameterNodes)
47525
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
47526
+ identifier.symbol = symbol2;
47527
+ expression = identifier;
47504
47528
  }
47505
47529
  return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression);
47506
47530
  }
@@ -47760,7 +47784,8 @@ function createTypeChecker(host) {
47760
47784
  }
47761
47785
  if (isLiteralImportTypeNode(node)) {
47762
47786
  const nodeSymbol = getNodeLinks(node).resolvedSymbol;
47763
- if (isInJSDoc(node) && nodeSymbol && (!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
47787
+ if (isInJSDoc(node) && nodeSymbol && // The import type resolved using jsdoc fallback logic
47788
+ (!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
47764
47789
  !(length(node.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))))) {
47765
47790
  return setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
47766
47791
  }
@@ -49277,8 +49302,10 @@ function createTypeChecker(host) {
49277
49302
  }
49278
49303
  }
49279
49304
  function getNameOfSymbolAsWritten(symbol, context) {
49280
- 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`
49281
- !symbol.declarations || context.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context.enclosingDeclaration, isDefaultBindingContext))) {
49305
+ 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`
49306
+ (!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
49307
+ !symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default`
49308
+ context.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context.enclosingDeclaration, isDefaultBindingContext))) {
49282
49309
  return "default";
49283
49310
  }
49284
49311
  if (symbol.declarations && symbol.declarations.length) {
@@ -50605,7 +50632,10 @@ function createTypeChecker(host) {
50605
50632
  function getWriteTypeOfSymbol(symbol) {
50606
50633
  const checkFlags = getCheckFlags(symbol);
50607
50634
  if (symbol.flags & 4 /* Property */) {
50608
- return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.links.writeType || symbol.links.type : getTypeOfSymbol(symbol);
50635
+ return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
50636
+ // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
50637
+ symbol.links.writeType || symbol.links.type
50638
+ ) : getTypeOfSymbol(symbol);
50609
50639
  }
50610
50640
  if (symbol.flags & 98304 /* Accessor */) {
50611
50641
  return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
@@ -59022,7 +59052,11 @@ function createTypeChecker(host) {
59022
59052
  if (variances === emptyArray) {
59023
59053
  return 1 /* Unknown */;
59024
59054
  }
59025
- const varianceResult = relateVariances(source2.aliasTypeArguments, target2.aliasTypeArguments, variances, intersectionState);
59055
+ const params = getSymbolLinks(source2.aliasSymbol).typeParameters;
59056
+ const minParams = getMinTypeArgumentCount(params);
59057
+ const sourceTypes = fillMissingTypeArguments(source2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration));
59058
+ const targetTypes = fillMissingTypeArguments(target2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration));
59059
+ const varianceResult = relateVariances(sourceTypes, targetTypes, variances, intersectionState);
59026
59060
  if (varianceResult !== void 0) {
59027
59061
  return varianceResult;
59028
59062
  }
@@ -61005,19 +61039,22 @@ function createTypeChecker(host) {
61005
61039
  break;
61006
61040
  case 166 /* Parameter */:
61007
61041
  const param = declaration;
61008
- if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
61009
- param,
61010
- param.name.escapedText,
61011
- 788968 /* Type */,
61012
- void 0,
61013
- param.name.escapedText,
61014
- /*isUse*/
61015
- true
61016
- ) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) {
61017
- const newName = "arg" + param.parent.parameters.indexOf(param);
61018
- const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
61019
- errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
61020
- return;
61042
+ if (isIdentifier(param.name)) {
61043
+ const originalKeywordKind = identifierToKeywordKind(param.name);
61044
+ if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
61045
+ param,
61046
+ param.name.escapedText,
61047
+ 788968 /* Type */,
61048
+ void 0,
61049
+ param.name.escapedText,
61050
+ /*isUse*/
61051
+ true
61052
+ ) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) {
61053
+ const newName = "arg" + param.parent.parameters.indexOf(param);
61054
+ const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
61055
+ errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
61056
+ return;
61057
+ }
61021
61058
  }
61022
61059
  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;
61023
61060
  break;
@@ -61205,6 +61242,10 @@ function createTypeChecker(host) {
61205
61242
  function isTypeParameterAtTopLevel(type, typeParameter) {
61206
61243
  return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter));
61207
61244
  }
61245
+ function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) {
61246
+ const typePredicate = getTypePredicateOfSignature(signature);
61247
+ return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter);
61248
+ }
61208
61249
  function createEmptyObjectTypeFromStringLiteral(type) {
61209
61250
  const members = createSymbolTable();
61210
61251
  forEachType(type, (t) => {
@@ -61479,7 +61520,11 @@ function createTypeChecker(host) {
61479
61520
  }
61480
61521
  if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
61481
61522
  if (source.aliasTypeArguments) {
61482
- inferFromTypeArguments(source.aliasTypeArguments, target.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
61523
+ const params = getSymbolLinks(source.aliasSymbol).typeParameters;
61524
+ const minParams = getMinTypeArgumentCount(params);
61525
+ const sourceTypes = fillMissingTypeArguments(source.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration));
61526
+ const targetTypes = fillMissingTypeArguments(target.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration));
61527
+ inferFromTypeArguments(sourceTypes, targetTypes, getAliasVariances(source.aliasSymbol));
61483
61528
  }
61484
61529
  return;
61485
61530
  }
@@ -62072,7 +62117,7 @@ function createTypeChecker(host) {
62072
62117
  function getCovariantInference(inference, signature) {
62073
62118
  const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
62074
62119
  const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter);
62075
- const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter));
62120
+ const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter));
62076
62121
  const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates;
62077
62122
  const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
62078
62123
  return getWidenedType(unwidenedType);
@@ -63886,18 +63931,20 @@ function createTypeChecker(host) {
63886
63931
  return narrowTypeByTypeFacts(type, nonPrimitiveType, 128 /* TypeofEQHostObject */);
63887
63932
  }
63888
63933
  function narrowTypeByTypeFacts(type, impliedType, facts) {
63889
- return mapType(type, (t) => // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate
63890
- // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
63891
- // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
63892
- // but are classified as "function" according to `typeof`.
63893
- isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : (
63894
- // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
63895
- // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
63896
- isTypeSubtypeOf(impliedType, t) ? impliedType : (
63897
- // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
63898
- // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
63899
- // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
63900
- getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType
63934
+ return mapType(type, (t) => (
63935
+ // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate
63936
+ // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
63937
+ // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
63938
+ // but are classified as "function" according to `typeof`.
63939
+ isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : (
63940
+ // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
63941
+ // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
63942
+ isTypeSubtypeOf(impliedType, t) ? impliedType : (
63943
+ // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
63944
+ // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
63945
+ // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
63946
+ getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType
63947
+ )
63901
63948
  )
63902
63949
  ));
63903
63950
  }
@@ -71468,7 +71515,8 @@ function createTypeChecker(host) {
71468
71515
  }
71469
71516
  }
71470
71517
  function isIndirectCall(node) {
71471
- 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");
71518
+ 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.
71519
+ (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval");
71472
71520
  }
71473
71521
  function checkForDisallowedESSymbolOperand(operator2) {
71474
71522
  const offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint(leftType, 12288 /* ESSymbolLike */) ? left : maybeTypeOfKindConsideringBaseConstraint(rightType, 12288 /* ESSymbolLike */) ? right : void 0;
@@ -72798,8 +72846,11 @@ function createTypeChecker(host) {
72798
72846
  }
72799
72847
  function checkTypeReferenceNode(node) {
72800
72848
  checkGrammarTypeArguments(node, node.typeArguments);
72801
- if (node.kind === 180 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
72802
- grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
72849
+ if (node.kind === 180 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) {
72850
+ const sourceFile = getSourceFileOfNode(node);
72851
+ if (scanTokenAtPosition(sourceFile, node.typeName.end) === 24 /* DotToken */) {
72852
+ grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
72853
+ }
72803
72854
  }
72804
72855
  forEach(node.typeArguments, checkSourceElement);
72805
72856
  const type = getTypeFromTypeReference(node);
@@ -78408,8 +78459,9 @@ function createTypeChecker(host) {
78408
78459
  }
78409
78460
  }
78410
78461
  function getReferencedImportDeclaration(nodeIn) {
78411
- if (nodeIn.generatedImportReference) {
78412
- return nodeIn.generatedImportReference;
78462
+ const specifier = getIdentifierGeneratedImportReference(nodeIn);
78463
+ if (specifier) {
78464
+ return specifier;
78413
78465
  }
78414
78466
  const node = getParseTreeNode(nodeIn, isIdentifier);
78415
78467
  if (node) {
@@ -78553,7 +78605,12 @@ function createTypeChecker(host) {
78553
78605
  return false;
78554
78606
  const symbol = getSymbolOfDeclaration(node);
78555
78607
  const signaturesOfSymbol = getSignaturesOfSymbol(symbol);
78556
- return signaturesOfSymbol.length > 1 || signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node;
78608
+ return signaturesOfSymbol.length > 1 || // If there is single signature for the symbol, it is overload if that signature isn't coming from the node
78609
+ // e.g.: function foo(a: string): string;
78610
+ // function foo(a: any) { // This is implementation of the overloads
78611
+ // return a;
78612
+ // }
78613
+ signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node;
78557
78614
  }
78558
78615
  return false;
78559
78616
  }
@@ -80382,7 +80439,7 @@ function createTypeChecker(host) {
80382
80439
  }
80383
80440
  function checkGrammarNameInLetOrConstDeclarations(name) {
80384
80441
  if (name.kind === 79 /* Identifier */) {
80385
- if (name.originalKeywordKind === 119 /* LetKeyword */) {
80442
+ if (name.escapedText === "let") {
80386
80443
  return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
80387
80444
  }
80388
80445
  } else {
@@ -81186,12 +81243,6 @@ function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, toke
81186
81243
  return fn === void 0 ? node : fn(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor);
81187
81244
  }
81188
81245
  var visitEachChildTable = {
81189
- [79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
81190
- return context.factory.updateIdentifier(
81191
- node,
81192
- nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)
81193
- );
81194
- },
81195
81246
  [163 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
81196
81247
  return context.factory.updateQualifiedName(
81197
81248
  node,
@@ -86227,7 +86278,7 @@ function transformClassFields(context) {
86227
86278
  if (isClassWithConstructorReference) {
86228
86279
  enableSubstitutionForClassAliases();
86229
86280
  const alias = factory2.cloneNode(temp);
86230
- alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
86281
+ alias.emitNode.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
86231
86282
  classAliases[getOriginalNodeId(node)] = alias;
86232
86283
  }
86233
86284
  setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression));
@@ -90363,7 +90414,7 @@ function transformJsx(context) {
90363
90414
  factory2.createIdentifier(name),
90364
90415
  generatedName
90365
90416
  );
90366
- generatedName.generatedImportReference = specifier;
90417
+ setIdentifierGeneratedImportReference(generatedName, specifier);
90367
90418
  specifierSourceImports.set(name, specifier);
90368
90419
  return generatedName;
90369
90420
  }
@@ -91506,7 +91557,7 @@ function transformES2015(context) {
91506
91557
  return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments"));
91507
91558
  }
91508
91559
  }
91509
- if (node.hasExtendedUnicodeEscape) {
91560
+ if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) {
91510
91561
  return setOriginalNode(setTextRange(
91511
91562
  factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)),
91512
91563
  node
@@ -94387,7 +94438,7 @@ function transformES5(context) {
94387
94438
  return node;
94388
94439
  }
94389
94440
  function trySubstituteReservedName(name) {
94390
- const token = name.originalKeywordKind || (nodeIsSynthesized(name) ? stringToToken(idText(name)) : void 0);
94441
+ const token = identifierToKeywordKind(name);
94391
94442
  if (token !== void 0 && token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */) {
94392
94443
  return setTextRange(factory2.createStringLiteralFromNode(name), name);
94393
94444
  }
@@ -98055,7 +98106,7 @@ function transformModule(context) {
98055
98106
  return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
98056
98107
  }
98057
98108
  return node;
98058
- } else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
98109
+ } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
98059
98110
  const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
98060
98111
  if (exportContainer && exportContainer.kind === 308 /* SourceFile */) {
98061
98112
  return setTextRange(
@@ -104008,7 +104059,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
104008
104059
  /*includeTrivia*/
104009
104060
  false
104010
104061
  ), node.symbol);
104011
- emitList(node, node.typeArguments, 53776 /* TypeParameters */);
104062
+ emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */);
104012
104063
  }
104013
104064
  function emitPrivateIdentifier(node) {
104014
104065
  write(getTextOfNode2(
@@ -106726,10 +106777,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
106726
106777
  }
106727
106778
  }
106728
106779
  function generateName(name) {
106729
- if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
106730
- return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix);
106780
+ const autoGenerate = name.emitNode.autoGenerate;
106781
+ if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
106782
+ return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix);
106731
106783
  } else {
106732
- const autoGenerateId = name.autoGenerate.id;
106784
+ const autoGenerateId = autoGenerate.id;
106733
106785
  return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name));
106734
106786
  }
106735
106787
  }
@@ -107009,16 +107061,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
107009
107061
  }
107010
107062
  }
107011
107063
  function makeName(name) {
107012
- const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName);
107013
- const suffix = formatGeneratedNamePart(name.autoGenerate.suffix);
107014
- switch (name.autoGenerate.flags & 7 /* KindMask */) {
107064
+ const autoGenerate = name.emitNode.autoGenerate;
107065
+ const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName);
107066
+ const suffix = formatGeneratedNamePart(autoGenerate.suffix);
107067
+ switch (autoGenerate.flags & 7 /* KindMask */) {
107015
107068
  case 1 /* Auto */:
107016
- return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
107069
+ return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
107017
107070
  case 2 /* Loop */:
107018
107071
  Debug.assertNode(name, isIdentifier);
107019
107072
  return makeTempVariableName(
107020
107073
  TempFlags._i,
107021
- !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
107074
+ !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */),
107022
107075
  /*privateName*/
107023
107076
  false,
107024
107077
  prefix,
@@ -107027,16 +107080,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
107027
107080
  case 3 /* Unique */:
107028
107081
  return makeUniqueName(
107029
107082
  idText(name),
107030
- name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
107031
- !!(name.autoGenerate.flags & 16 /* Optimistic */),
107032
- !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
107083
+ autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
107084
+ !!(autoGenerate.flags & 16 /* Optimistic */),
107085
+ !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */),
107033
107086
  isPrivateIdentifier(name),
107034
107087
  prefix,
107035
107088
  suffix
107036
107089
  );
107037
107090
  }
107038
107091
  return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(
107039
- name.autoGenerate.flags & 7 /* KindMask */,
107092
+ autoGenerate.flags & 7 /* KindMask */,
107040
107093
  GeneratedIdentifierFlags,
107041
107094
  /*isFlags*/
107042
107095
  true
@@ -108966,7 +109019,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
108966
109019
  const oldSourceFiles = oldProgram.getSourceFiles();
108967
109020
  for (const oldSourceFile of oldSourceFiles) {
108968
109021
  const newFile = getSourceFileByPath(oldSourceFile.resolvedPath);
108969
- if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) {
109022
+ if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || // old file wasn't redirect but new file is
109023
+ oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) {
108970
109024
  host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path));
108971
109025
  }
108972
109026
  }
@@ -113662,7 +113716,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
113662
113716
  const name = loader.nameAndMode.getName(entry);
113663
113717
  const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
113664
113718
  let resolution = resolutionsInFile.get(name, mode);
113665
- if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
113719
+ if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate
113720
+ hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
113666
113721
  const existingResolution = resolution;
113667
113722
  resolution = loader.resolve(name, mode);
113668
113723
  if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {