typescript 5.3.0-dev.20230816 → 5.3.0-dev.20230817

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.
Files changed (43) hide show
  1. package/lib/lib.decorators.d.ts +3 -6
  2. package/lib/lib.es2015.collection.d.ts +1 -2
  3. package/lib/lib.es2015.core.d.ts +1 -1
  4. package/lib/lib.es2015.iterable.d.ts +4 -5
  5. package/lib/lib.es2015.promise.d.ts +1 -1
  6. package/lib/lib.es2015.symbol.d.ts +1 -1
  7. package/lib/lib.es2016.array.include.d.ts +1 -1
  8. package/lib/lib.es2016.d.ts +1 -1
  9. package/lib/lib.es2016.full.d.ts +1 -1
  10. package/lib/lib.es2017.full.d.ts +1 -1
  11. package/lib/lib.es2017.intl.d.ts +11 -12
  12. package/lib/lib.es2017.object.d.ts +3 -3
  13. package/lib/lib.es2018.asynciterable.d.ts +1 -1
  14. package/lib/lib.es2018.full.d.ts +1 -1
  15. package/lib/lib.es2018.intl.d.ts +1 -2
  16. package/lib/lib.es2018.promise.d.ts +1 -1
  17. package/lib/lib.es2018.regexp.d.ts +5 -5
  18. package/lib/lib.es2019.array.d.ts +14 -18
  19. package/lib/lib.es2019.intl.d.ts +1 -1
  20. package/lib/lib.es2019.object.d.ts +1 -1
  21. package/lib/lib.es2020.bigint.d.ts +7 -7
  22. package/lib/lib.es2020.date.d.ts +1 -1
  23. package/lib/lib.es2020.intl.d.ts +11 -13
  24. package/lib/lib.es2020.promise.d.ts +1 -1
  25. package/lib/lib.es2021.intl.d.ts +5 -6
  26. package/lib/lib.es2021.promise.d.ts +3 -3
  27. package/lib/lib.es2021.weakref.d.ts +2 -2
  28. package/lib/lib.es2022.error.d.ts +2 -2
  29. package/lib/lib.es2022.intl.d.ts +1 -2
  30. package/lib/lib.es2022.sharedmemory.d.ts +2 -2
  31. package/lib/lib.es2023.array.d.ts +61 -61
  32. package/lib/lib.es5.d.ts +74 -88
  33. package/lib/lib.esnext.disposable.d.ts +10 -10
  34. package/lib/lib.esnext.full.d.ts +1 -1
  35. package/lib/lib.esnext.intl.d.ts +7 -7
  36. package/lib/lib.scripthost.d.ts +1 -4
  37. package/lib/lib.webworker.importscripts.d.ts +0 -1
  38. package/lib/tsc.js +1241 -1390
  39. package/lib/tsserver.js +1781 -2009
  40. package/lib/typescript.d.ts +339 -117
  41. package/lib/typescript.js +1781 -2009
  42. package/lib/typingsInstaller.js +119 -105
  43. package/package.json +4 -2
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.3";
21
- var version = `${versionMajorMinor}.0-dev.20230816`;
21
+ var version = `${versionMajorMinor}.0-dev.20230817`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -1739,17 +1739,21 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1739
1739
  return `${flowHeader}${remainingFlags ? ` (${formatFlowFlags(remainingFlags)})` : ""}`;
1740
1740
  }
1741
1741
  },
1742
- __debugFlowFlags: { get() {
1743
- return formatEnum(
1744
- this.flags,
1745
- FlowFlags,
1746
- /*isFlags*/
1747
- true
1748
- );
1749
- } },
1750
- __debugToString: { value() {
1751
- return formatControlFlowGraph(this);
1752
- } }
1742
+ __debugFlowFlags: {
1743
+ get() {
1744
+ return formatEnum(
1745
+ this.flags,
1746
+ FlowFlags,
1747
+ /*isFlags*/
1748
+ true
1749
+ );
1750
+ }
1751
+ },
1752
+ __debugToString: {
1753
+ value() {
1754
+ return formatControlFlowGraph(this);
1755
+ }
1756
+ }
1753
1757
  });
1754
1758
  }
1755
1759
  }
@@ -1808,9 +1812,11 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1808
1812
  return `${symbolHeader} '${symbolName(this)}'${remainingSymbolFlags ? ` (${formatSymbolFlags(remainingSymbolFlags)})` : ""}`;
1809
1813
  }
1810
1814
  },
1811
- __debugFlags: { get() {
1812
- return formatSymbolFlags(this.flags);
1813
- } }
1815
+ __debugFlags: {
1816
+ get() {
1817
+ return formatSymbolFlags(this.flags);
1818
+ }
1819
+ }
1814
1820
  });
1815
1821
  Object.defineProperties(objectAllocator.getTypeConstructor().prototype, {
1816
1822
  // for use with vscode-js-debug's new customDescriptionGenerator in launch.json
@@ -1821,12 +1827,16 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1821
1827
  return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`;
1822
1828
  }
1823
1829
  },
1824
- __debugFlags: { get() {
1825
- return formatTypeFlags(this.flags);
1826
- } },
1827
- __debugObjectFlags: { get() {
1828
- return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : "";
1829
- } },
1830
+ __debugFlags: {
1831
+ get() {
1832
+ return formatTypeFlags(this.flags);
1833
+ }
1834
+ },
1835
+ __debugObjectFlags: {
1836
+ get() {
1837
+ return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : "";
1838
+ }
1839
+ },
1830
1840
  __debugTypeToString: {
1831
1841
  value() {
1832
1842
  let text = weakTypeTextMap.get(this);
@@ -1839,13 +1849,17 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1839
1849
  }
1840
1850
  });
1841
1851
  Object.defineProperties(objectAllocator.getSignatureConstructor().prototype, {
1842
- __debugFlags: { get() {
1843
- return formatSignatureFlags(this.flags);
1844
- } },
1845
- __debugSignatureToString: { value() {
1846
- var _a;
1847
- return (_a = this.checker) == null ? void 0 : _a.signatureToString(this);
1848
- } }
1852
+ __debugFlags: {
1853
+ get() {
1854
+ return formatSignatureFlags(this.flags);
1855
+ }
1856
+ },
1857
+ __debugSignatureToString: {
1858
+ value() {
1859
+ var _a;
1860
+ return (_a = this.checker) == null ? void 0 : _a.signatureToString(this);
1861
+ }
1862
+ }
1849
1863
  });
1850
1864
  const nodeConstructors = [
1851
1865
  objectAllocator.getNodeConstructor(),
@@ -1863,24 +1877,36 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1863
1877
  return `${nodeHeader}${this.flags ? ` (${formatNodeFlags(this.flags)})` : ""}`;
1864
1878
  }
1865
1879
  },
1866
- __debugKind: { get() {
1867
- return formatSyntaxKind(this.kind);
1868
- } },
1869
- __debugNodeFlags: { get() {
1870
- return formatNodeFlags(this.flags);
1871
- } },
1872
- __debugModifierFlags: { get() {
1873
- return formatModifierFlags(getEffectiveModifierFlagsNoCache(this));
1874
- } },
1875
- __debugTransformFlags: { get() {
1876
- return formatTransformFlags(this.transformFlags);
1877
- } },
1878
- __debugIsParseTreeNode: { get() {
1879
- return isParseTreeNode(this);
1880
- } },
1881
- __debugEmitFlags: { get() {
1882
- return formatEmitFlags(getEmitFlags(this));
1883
- } },
1880
+ __debugKind: {
1881
+ get() {
1882
+ return formatSyntaxKind(this.kind);
1883
+ }
1884
+ },
1885
+ __debugNodeFlags: {
1886
+ get() {
1887
+ return formatNodeFlags(this.flags);
1888
+ }
1889
+ },
1890
+ __debugModifierFlags: {
1891
+ get() {
1892
+ return formatModifierFlags(getEffectiveModifierFlagsNoCache(this));
1893
+ }
1894
+ },
1895
+ __debugTransformFlags: {
1896
+ get() {
1897
+ return formatTransformFlags(this.transformFlags);
1898
+ }
1899
+ },
1900
+ __debugIsParseTreeNode: {
1901
+ get() {
1902
+ return isParseTreeNode(this);
1903
+ }
1904
+ },
1905
+ __debugEmitFlags: {
1906
+ get() {
1907
+ return formatEmitFlags(getEmitFlags(this));
1908
+ }
1909
+ },
1884
1910
  __debugGetText: {
1885
1911
  value(includeTrivia) {
1886
1912
  if (nodeIsSynthesized(this))
@@ -2520,15 +2546,21 @@ function parseComparator(operator, text, comparators) {
2520
2546
  switch (operator) {
2521
2547
  case "~":
2522
2548
  comparators.push(createComparator(">=", version2));
2523
- comparators.push(createComparator("<", version2.increment(
2524
- isWildcard(minor) ? "major" : "minor"
2525
- )));
2549
+ comparators.push(createComparator(
2550
+ "<",
2551
+ version2.increment(
2552
+ isWildcard(minor) ? "major" : "minor"
2553
+ )
2554
+ ));
2526
2555
  break;
2527
2556
  case "^":
2528
2557
  comparators.push(createComparator(">=", version2));
2529
- comparators.push(createComparator("<", version2.increment(
2530
- version2.major > 0 || isWildcard(minor) ? "major" : version2.minor > 0 || isWildcard(patch) ? "minor" : "patch"
2531
- )));
2558
+ comparators.push(createComparator(
2559
+ "<",
2560
+ version2.increment(
2561
+ version2.major > 0 || isWildcard(minor) ? "major" : version2.minor > 0 || isWildcard(patch) ? "minor" : "patch"
2562
+ )
2563
+ ));
2532
2564
  break;
2533
2565
  case "<":
2534
2566
  case ">=":
@@ -2807,11 +2839,7 @@ var tracingEnabled;
2807
2839
  const meta = { cat: "__metadata", ph: "M", ts: 1e3 * timestamp(), pid: 1, tid: 1 };
2808
2840
  fs.writeSync(
2809
2841
  traceFd,
2810
- "[\n" + [
2811
- { name: "process_name", args: { name: "tsc" }, ...meta },
2812
- { name: "thread_name", args: { name: "Main" }, ...meta },
2813
- { name: "TracingStartedInBrowser", ...meta, cat: "disabled-by-default-devtools.timeline" }
2814
- ].map((v) => JSON.stringify(v)).join(",\n")
2842
+ "[\n" + [{ name: "process_name", args: { name: "tsc" }, ...meta }, { name: "thread_name", args: { name: "Main" }, ...meta }, { name: "TracingStartedInBrowser", ...meta, cat: "disabled-by-default-devtools.timeline" }].map((v) => JSON.stringify(v)).join(",\n")
2815
2843
  );
2816
2844
  }
2817
2845
  tracingEnabled2.startTracing = startTracing2;
@@ -5297,7 +5325,9 @@ var sys = (() => {
5297
5325
  })();
5298
5326
  if (sys && sys.getEnvironmentVariable) {
5299
5327
  setCustomPollingValues(sys);
5300
- Debug.setAssertionLevel(/^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */);
5328
+ Debug.setAssertionLevel(
5329
+ /^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */
5330
+ );
5301
5331
  }
5302
5332
  if (sys && sys.debugMode) {
5303
5333
  Debug.isDebugging = true;
@@ -12673,10 +12703,7 @@ function isPartOfTypeNode(node) {
12673
12703
  } else if (node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node) {
12674
12704
  node = node.parent;
12675
12705
  }
12676
- Debug.assert(
12677
- node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */,
12678
- "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."
12679
- );
12706
+ Debug.assert(node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
12680
12707
  case 166 /* QualifiedName */:
12681
12708
  case 211 /* PropertyAccessExpression */:
12682
12709
  case 110 /* ThisKeyword */: {
@@ -12879,11 +12906,7 @@ function forEachPropertyAssignment(objectLiteral, key, callback, key2) {
12879
12906
  });
12880
12907
  }
12881
12908
  function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
12882
- return forEachPropertyAssignment(
12883
- objectLiteral,
12884
- propKey,
12885
- (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0
12886
- );
12909
+ return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0);
12887
12910
  }
12888
12911
  function getTsConfigObjectLiteralExpression(tsConfigSourceFile) {
12889
12912
  if (tsConfigSourceFile && tsConfigSourceFile.statements.length) {
@@ -15049,9 +15072,16 @@ function getSourceFilePathInNewDirWorker(fileName, newDirPath, currentDirectory,
15049
15072
  return combinePaths(newDirPath, sourceFilePath);
15050
15073
  }
15051
15074
  function writeFile(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) {
15052
- host.writeFile(fileName, text, writeByteOrderMark, (hostErrorMessage) => {
15053
- diagnostics.add(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage));
15054
- }, sourceFiles, data);
15075
+ host.writeFile(
15076
+ fileName,
15077
+ text,
15078
+ writeByteOrderMark,
15079
+ (hostErrorMessage) => {
15080
+ diagnostics.add(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage));
15081
+ },
15082
+ sourceFiles,
15083
+ data
15084
+ );
15055
15085
  }
15056
15086
  function ensureDirectoriesExist(directoryPath, createDirectory, directoryExists) {
15057
15087
  if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) {
@@ -15921,21 +15951,17 @@ function isUMDExportSymbol(symbol) {
15921
15951
  }
15922
15952
  function getLastChild(node) {
15923
15953
  let lastChild;
15924
- forEachChild(
15925
- node,
15926
- (child) => {
15927
- if (nodeIsPresent(child))
15928
- lastChild = child;
15929
- },
15930
- (children) => {
15931
- for (let i = children.length - 1; i >= 0; i--) {
15932
- if (nodeIsPresent(children[i])) {
15933
- lastChild = children[i];
15934
- break;
15935
- }
15954
+ forEachChild(node, (child) => {
15955
+ if (nodeIsPresent(child))
15956
+ lastChild = child;
15957
+ }, (children) => {
15958
+ for (let i = children.length - 1; i >= 0; i--) {
15959
+ if (nodeIsPresent(children[i])) {
15960
+ lastChild = children[i];
15961
+ break;
15936
15962
  }
15937
15963
  }
15938
- );
15964
+ });
15939
15965
  return lastChild;
15940
15966
  }
15941
15967
  function isTypeNodeKind(kind) {
@@ -25068,21 +25094,18 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
25068
25094
  if (some(helperNames)) {
25069
25095
  helperNames.sort(compareStringsCaseSensitive);
25070
25096
  namedBindings = nodeFactory.createNamedImports(
25071
- map(
25072
- helperNames,
25073
- (name) => isFileLevelUniqueName(sourceFile, name) ? nodeFactory.createImportSpecifier(
25074
- /*isTypeOnly*/
25075
- false,
25076
- /*propertyName*/
25077
- void 0,
25078
- nodeFactory.createIdentifier(name)
25079
- ) : nodeFactory.createImportSpecifier(
25080
- /*isTypeOnly*/
25081
- false,
25082
- nodeFactory.createIdentifier(name),
25083
- helperFactory.getUnscopedHelperName(name)
25084
- )
25085
- )
25097
+ map(helperNames, (name) => isFileLevelUniqueName(sourceFile, name) ? nodeFactory.createImportSpecifier(
25098
+ /*isTypeOnly*/
25099
+ false,
25100
+ /*propertyName*/
25101
+ void 0,
25102
+ nodeFactory.createIdentifier(name)
25103
+ ) : nodeFactory.createImportSpecifier(
25104
+ /*isTypeOnly*/
25105
+ false,
25106
+ nodeFactory.createIdentifier(name),
25107
+ helperFactory.getUnscopedHelperName(name)
25108
+ ))
25086
25109
  );
25087
25110
  const parseNode = getOriginalNode(sourceFile, isSourceFile);
25088
25111
  const emitNode = getOrCreateEmitNode(parseNode);
@@ -33125,16 +33148,7 @@ var IncrementalParser;
33125
33148
  Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span));
33126
33149
  Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange)));
33127
33150
  const delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length;
33128
- updateTokenPositionsAndMarkElements(
33129
- incrementalSourceFile,
33130
- changeRange.span.start,
33131
- textSpanEnd(changeRange.span),
33132
- textSpanEnd(textChangeRangeNewSpan(changeRange)),
33133
- delta,
33134
- oldText,
33135
- newText,
33136
- aggressiveChecks
33137
- );
33151
+ updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks);
33138
33152
  const result = Parser.parseSourceFile(
33139
33153
  sourceFile.fileName,
33140
33154
  newText,
@@ -36288,14 +36302,17 @@ function getExtendsConfigPathOrArray(value, host, basePath, configFileName, erro
36288
36302
  for (let index = 0; index < value.length; index++) {
36289
36303
  const fileName = value[index];
36290
36304
  if (isString(fileName)) {
36291
- extendedConfigPath = append(extendedConfigPath, getExtendsConfigPath(
36292
- fileName,
36293
- host,
36294
- newBase,
36295
- errors,
36296
- valueExpression == null ? void 0 : valueExpression.elements[index],
36297
- sourceFile
36298
- ));
36305
+ extendedConfigPath = append(
36306
+ extendedConfigPath,
36307
+ getExtendsConfigPath(
36308
+ fileName,
36309
+ host,
36310
+ newBase,
36311
+ errors,
36312
+ valueExpression == null ? void 0 : valueExpression.elements[index],
36313
+ sourceFile
36314
+ )
36315
+ );
36299
36316
  } else {
36300
36317
  convertJsonOption(extendsOptionDeclaration.element, value, basePath, errors, propertyAssignment, valueExpression == null ? void 0 : valueExpression.elements[index], sourceFile);
36301
36318
  }
@@ -37140,12 +37157,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
37140
37157
  }
37141
37158
  }
37142
37159
  return resolvedTypeScriptOnly(
37143
- loadNodeModuleFromDirectory(
37144
- 4 /* Declaration */,
37145
- candidate,
37146
- !directoryExists,
37147
- moduleResolutionState
37148
- )
37160
+ loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, moduleResolutionState)
37149
37161
  );
37150
37162
  });
37151
37163
  } else {
@@ -38621,13 +38633,15 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38621
38633
  false,
38622
38634
  redirectedReference
38623
38635
  );
38624
- return toSearchResult(result.resolvedModule ? {
38625
- path: result.resolvedModule.resolvedFileName,
38626
- extension: result.resolvedModule.extension,
38627
- packageId: result.resolvedModule.packageId,
38628
- originalPath: result.resolvedModule.originalPath,
38629
- resolvedUsingTsExtension: result.resolvedModule.resolvedUsingTsExtension
38630
- } : void 0);
38636
+ return toSearchResult(
38637
+ result.resolvedModule ? {
38638
+ path: result.resolvedModule.resolvedFileName,
38639
+ extension: result.resolvedModule.extension,
38640
+ packageId: result.resolvedModule.packageId,
38641
+ originalPath: result.resolvedModule.originalPath,
38642
+ resolvedUsingTsExtension: result.resolvedModule.resolvedUsingTsExtension
38643
+ } : void 0
38644
+ );
38631
38645
  }
38632
38646
  if (state.traceEnabled) {
38633
38647
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
@@ -38660,13 +38674,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38660
38674
  );
38661
38675
  }
38662
38676
  if (state.traceEnabled) {
38663
- trace(
38664
- state.host,
38665
- Diagnostics.Using_0_subpath_1_with_target_2,
38666
- isImports ? "imports" : "exports",
38667
- key,
38668
- pattern ? target.replace(/\*/g, subpath) : target + subpath
38669
- );
38677
+ trace(state.host, Diagnostics.Using_0_subpath_1_with_target_2, isImports ? "imports" : "exports", key, pattern ? target.replace(/\*/g, subpath) : target + subpath);
38670
38678
  }
38671
38679
  const finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath);
38672
38680
  const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports);
@@ -40889,31 +40897,15 @@ function createBinder() {
40889
40897
  return;
40890
40898
  }
40891
40899
  if (inStrictMode && originalKeywordKind >= 119 /* FirstFutureReservedWord */ && originalKeywordKind <= 127 /* LastFutureReservedWord */) {
40892
- file.bindDiagnostics.push(createDiagnosticForNode2(
40893
- node,
40894
- getStrictModeIdentifierMessage(node),
40895
- declarationNameToString(node)
40896
- ));
40900
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, getStrictModeIdentifierMessage(node), declarationNameToString(node)));
40897
40901
  } else if (originalKeywordKind === 135 /* AwaitKeyword */) {
40898
40902
  if (isExternalModule(file) && isInTopLevelContext(node)) {
40899
- file.bindDiagnostics.push(createDiagnosticForNode2(
40900
- node,
40901
- Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module,
40902
- declarationNameToString(node)
40903
- ));
40903
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, declarationNameToString(node)));
40904
40904
  } else if (node.flags & 65536 /* AwaitContext */) {
40905
- file.bindDiagnostics.push(createDiagnosticForNode2(
40906
- node,
40907
- Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,
40908
- declarationNameToString(node)
40909
- ));
40905
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
40910
40906
  }
40911
40907
  } else if (originalKeywordKind === 127 /* YieldKeyword */ && node.flags & 16384 /* YieldContext */) {
40912
- file.bindDiagnostics.push(createDiagnosticForNode2(
40913
- node,
40914
- Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,
40915
- declarationNameToString(node)
40916
- ));
40908
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
40917
40909
  }
40918
40910
  }
40919
40911
  }
@@ -40929,11 +40921,7 @@ function createBinder() {
40929
40921
  function checkPrivateIdentifier(node) {
40930
40922
  if (node.escapedText === "#constructor") {
40931
40923
  if (!file.parseDiagnostics.length) {
40932
- file.bindDiagnostics.push(createDiagnosticForNode2(
40933
- node,
40934
- Diagnostics.constructor_is_a_reserved_word,
40935
- declarationNameToString(node)
40936
- ));
40924
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.constructor_is_a_reserved_word, declarationNameToString(node)));
40937
40925
  }
40938
40926
  }
40939
40927
  }
@@ -40961,13 +40949,7 @@ function createBinder() {
40961
40949
  const identifier = name;
40962
40950
  if (isEvalOrArgumentsIdentifier(identifier)) {
40963
40951
  const span = getErrorSpanForNode(file, name);
40964
- file.bindDiagnostics.push(createFileDiagnostic(
40965
- file,
40966
- span.start,
40967
- span.length,
40968
- getStrictModeEvalOrArgumentsMessage(contextNode),
40969
- idText(identifier)
40970
- ));
40952
+ file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), idText(identifier)));
40971
40953
  }
40972
40954
  }
40973
40955
  }
@@ -40998,12 +40980,7 @@ function createBinder() {
40998
40980
  if (languageVersion < 2 /* ES2015 */) {
40999
40981
  if (blockScopeContainer.kind !== 312 /* SourceFile */ && blockScopeContainer.kind !== 267 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
41000
40982
  const errorSpan = getErrorSpanForNode(file, node);
41001
- file.bindDiagnostics.push(createFileDiagnostic(
41002
- file,
41003
- errorSpan.start,
41004
- errorSpan.length,
41005
- getStrictModeBlockScopeFunctionDeclarationMessage(node)
41006
- ));
40983
+ file.bindDiagnostics.push(createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node)));
41007
40984
  }
41008
40985
  }
41009
40986
  }
@@ -41234,11 +41211,7 @@ function createBinder() {
41234
41211
  return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */);
41235
41212
  case 174 /* MethodDeclaration */:
41236
41213
  case 173 /* MethodSignature */:
41237
- return bindPropertyOrMethodOrAccessor(
41238
- node,
41239
- 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */),
41240
- isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */
41241
- );
41214
+ return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */);
41242
41215
  case 262 /* FunctionDeclaration */:
41243
41216
  return bindFunctionDeclaration(node);
41244
41217
  case 176 /* Constructor */:
@@ -42575,32 +42548,29 @@ function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) {
42575
42548
  if (decl) {
42576
42549
  return decl.name.text;
42577
42550
  }
42578
- const ambientModuleDeclareCandidates = mapDefined(
42579
- moduleSymbol.declarations,
42580
- (d) => {
42581
- var _a2, _b, _c, _d;
42582
- if (!isModuleDeclaration(d))
42583
- return;
42584
- const topNamespace = getTopNamespace(d);
42585
- if (!(((_a2 = topNamespace == null ? void 0 : topNamespace.parent) == null ? void 0 : _a2.parent) && isModuleBlock(topNamespace.parent) && isAmbientModule(topNamespace.parent.parent) && isSourceFile(topNamespace.parent.parent.parent)))
42586
- return;
42587
- const exportAssignment = (_d = (_c = (_b = topNamespace.parent.parent.symbol.exports) == null ? void 0 : _b.get("export=")) == null ? void 0 : _c.valueDeclaration) == null ? void 0 : _d.expression;
42588
- if (!exportAssignment)
42589
- return;
42590
- const exportSymbol = checker.getSymbolAtLocation(exportAssignment);
42591
- if (!exportSymbol)
42592
- return;
42593
- const originalExportSymbol = (exportSymbol == null ? void 0 : exportSymbol.flags) & 2097152 /* Alias */ ? checker.getAliasedSymbol(exportSymbol) : exportSymbol;
42594
- if (originalExportSymbol === d.symbol)
42595
- return topNamespace.parent.parent;
42596
- function getTopNamespace(namespaceDeclaration) {
42597
- while (namespaceDeclaration.flags & 8 /* NestedNamespace */) {
42598
- namespaceDeclaration = namespaceDeclaration.parent;
42599
- }
42600
- return namespaceDeclaration;
42551
+ const ambientModuleDeclareCandidates = mapDefined(moduleSymbol.declarations, (d) => {
42552
+ var _a2, _b, _c, _d;
42553
+ if (!isModuleDeclaration(d))
42554
+ return;
42555
+ const topNamespace = getTopNamespace(d);
42556
+ if (!(((_a2 = topNamespace == null ? void 0 : topNamespace.parent) == null ? void 0 : _a2.parent) && isModuleBlock(topNamespace.parent) && isAmbientModule(topNamespace.parent.parent) && isSourceFile(topNamespace.parent.parent.parent)))
42557
+ return;
42558
+ const exportAssignment = (_d = (_c = (_b = topNamespace.parent.parent.symbol.exports) == null ? void 0 : _b.get("export=")) == null ? void 0 : _c.valueDeclaration) == null ? void 0 : _d.expression;
42559
+ if (!exportAssignment)
42560
+ return;
42561
+ const exportSymbol = checker.getSymbolAtLocation(exportAssignment);
42562
+ if (!exportSymbol)
42563
+ return;
42564
+ const originalExportSymbol = (exportSymbol == null ? void 0 : exportSymbol.flags) & 2097152 /* Alias */ ? checker.getAliasedSymbol(exportSymbol) : exportSymbol;
42565
+ if (originalExportSymbol === d.symbol)
42566
+ return topNamespace.parent.parent;
42567
+ function getTopNamespace(namespaceDeclaration) {
42568
+ while (namespaceDeclaration.flags & 8 /* NestedNamespace */) {
42569
+ namespaceDeclaration = namespaceDeclaration.parent;
42601
42570
  }
42571
+ return namespaceDeclaration;
42602
42572
  }
42603
- );
42573
+ });
42604
42574
  const ambientModuleDeclare = ambientModuleDeclareCandidates[0];
42605
42575
  if (ambientModuleDeclare) {
42606
42576
  return ambientModuleDeclare.name.text;
@@ -45288,10 +45258,7 @@ function createTypeChecker(host) {
45288
45258
  diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
45289
45259
  }
45290
45260
  if (diagnosticMessage) {
45291
- addRelatedInfo(
45292
- diagnosticMessage,
45293
- createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName)
45294
- );
45261
+ addRelatedInfo(diagnosticMessage, createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName));
45295
45262
  }
45296
45263
  }
45297
45264
  }
@@ -45467,11 +45434,14 @@ function createTypeChecker(host) {
45467
45434
  const exportAssignment = exportEqualsSymbol.valueDeclaration;
45468
45435
  const err = error(node.name, Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
45469
45436
  if (exportAssignment) {
45470
- addRelatedInfo(err, createDiagnosticForNode(
45471
- exportAssignment,
45472
- Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,
45473
- compilerOptionName
45474
- ));
45437
+ addRelatedInfo(
45438
+ err,
45439
+ createDiagnosticForNode(
45440
+ exportAssignment,
45441
+ Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,
45442
+ compilerOptionName
45443
+ )
45444
+ );
45475
45445
  }
45476
45446
  } else if (isImportClause(node)) {
45477
45447
  reportNonDefaultExport(moduleSymbol, node);
@@ -45528,10 +45498,12 @@ function createTypeChecker(host) {
45528
45498
  const diagnostic = error(node.name, Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol));
45529
45499
  const exportStar = (_b = moduleSymbol.exports) == null ? void 0 : _b.get("__export" /* ExportStar */);
45530
45500
  if (exportStar) {
45531
- const defaultExport = (_c = exportStar.declarations) == null ? void 0 : _c.find((decl) => {
45532
- var _a2, _b2;
45533
- return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (_a2 = resolveExternalModuleName(decl, decl.moduleSpecifier)) == null ? void 0 : _a2.exports) == null ? void 0 : _b2.has("default" /* Default */)));
45534
- });
45501
+ const defaultExport = (_c = exportStar.declarations) == null ? void 0 : _c.find(
45502
+ (decl) => {
45503
+ var _a2, _b2;
45504
+ return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (_a2 = resolveExternalModuleName(decl, decl.moduleSpecifier)) == null ? void 0 : _a2.exports) == null ? void 0 : _b2.has("default" /* Default */)));
45505
+ }
45506
+ );
45535
45507
  if (defaultExport) {
45536
45508
  addRelatedInfo(diagnostic, createDiagnosticForNode(defaultExport, Diagnostics.export_Asterisk_does_not_re_export_a_default));
45537
45509
  }
@@ -45678,10 +45650,7 @@ function createTypeChecker(host) {
45678
45650
  const suggestionName = symbolToString(suggestion);
45679
45651
  const diagnostic = error(name, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
45680
45652
  if (suggestion.valueDeclaration) {
45681
- addRelatedInfo(
45682
- diagnostic,
45683
- createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName)
45684
- );
45653
+ addRelatedInfo(diagnostic, createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName));
45685
45654
  }
45686
45655
  } else {
45687
45656
  if ((_a = moduleSymbol.exports) == null ? void 0 : _a.has("default" /* Default */)) {
@@ -45708,10 +45677,7 @@ function createTypeChecker(host) {
45708
45677
  const exportedSymbol = exports ? find(symbolsToArray(exports), (symbol) => !!getSymbolIfSameReference(symbol, localSymbol)) : void 0;
45709
45678
  const diagnostic = exportedSymbol ? error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) : error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
45710
45679
  if (localSymbol.declarations) {
45711
- addRelatedInfo(
45712
- diagnostic,
45713
- ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName))
45714
- );
45680
+ addRelatedInfo(diagnostic, ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName)));
45715
45681
  }
45716
45682
  }
45717
45683
  } else {
@@ -46376,11 +46342,15 @@ function createTypeChecker(host) {
46376
46342
  }
46377
46343
  }
46378
46344
  }
46379
- diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chainDiagnosticMessages(
46380
- diagnosticDetails,
46381
- Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead,
46382
- moduleReference
46383
- )));
46345
+ diagnostics.add(createDiagnosticForNodeFromMessageChain(
46346
+ getSourceFileOfNode(errorNode),
46347
+ errorNode,
46348
+ chainDiagnosticMessages(
46349
+ diagnosticDetails,
46350
+ Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead,
46351
+ moduleReference
46352
+ )
46353
+ ));
46384
46354
  }
46385
46355
  }
46386
46356
  }
@@ -46437,11 +46407,7 @@ function createTypeChecker(host) {
46437
46407
  const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
46438
46408
  const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
46439
46409
  if (suggestedExt) {
46440
- error(
46441
- errorNode,
46442
- Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0,
46443
- moduleReference + suggestedExt
46444
- );
46410
+ error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
46445
46411
  } else {
46446
46412
  error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
46447
46413
  }
@@ -46466,12 +46432,16 @@ function createTypeChecker(host) {
46466
46432
  if (!isExternalModuleNameRelative(moduleReference) && packageId) {
46467
46433
  errorInfo = createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageId.name);
46468
46434
  }
46469
- errorOrSuggestion(isError, errorNode, chainDiagnosticMessages(
46470
- errorInfo,
46471
- Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,
46472
- moduleReference,
46473
- resolvedFileName
46474
- ));
46435
+ errorOrSuggestion(
46436
+ isError,
46437
+ errorNode,
46438
+ chainDiagnosticMessages(
46439
+ errorInfo,
46440
+ Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,
46441
+ moduleReference,
46442
+ resolvedFileName
46443
+ )
46444
+ );
46475
46445
  }
46476
46446
  function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) {
46477
46447
  if (moduleSymbol == null ? void 0 : moduleSymbol.exports) {
@@ -46708,10 +46678,12 @@ function createTypeChecker(host) {
46708
46678
  }
46709
46679
  if (exportStar == null ? void 0 : exportStar.isTypeOnly) {
46710
46680
  typeOnlyExportStarMap ?? (typeOnlyExportStarMap = /* @__PURE__ */ new Map());
46711
- symbols.forEach((_, escapedName) => typeOnlyExportStarMap.set(
46712
- escapedName,
46713
- exportStar
46714
- ));
46681
+ symbols.forEach(
46682
+ (_, escapedName) => typeOnlyExportStarMap.set(
46683
+ escapedName,
46684
+ exportStar
46685
+ )
46686
+ );
46715
46687
  }
46716
46688
  return symbols;
46717
46689
  }
@@ -46947,13 +46919,7 @@ function createTypeChecker(host) {
46947
46919
  return resolved;
46948
46920
  }
46949
46921
  function createAnonymousType(symbol, members, callSignatures, constructSignatures, indexInfos) {
46950
- return setStructuredTypeMembers(
46951
- createObjectType(16 /* Anonymous */, symbol),
46952
- members,
46953
- callSignatures,
46954
- constructSignatures,
46955
- indexInfos
46956
- );
46922
+ return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, indexInfos);
46957
46923
  }
46958
46924
  function getResolvedTypeWithoutAbstractConstructSignatures(type) {
46959
46925
  if (type.constructSignatures.length === 0)
@@ -48183,11 +48149,7 @@ function createTypeChecker(host) {
48183
48149
  }
48184
48150
  } else {
48185
48151
  if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) {
48186
- qualifier = factory.updateQualifiedName(
48187
- qualifier,
48188
- qualifier.left,
48189
- setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments)
48190
- );
48152
+ qualifier = factory.updateQualifiedName(qualifier, qualifier.left, setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments));
48191
48153
  }
48192
48154
  }
48193
48155
  }
@@ -48213,11 +48175,7 @@ function createTypeChecker(host) {
48213
48175
  }
48214
48176
  } else {
48215
48177
  if (typeArguments !== getIdentifierTypeArguments(typeName.right)) {
48216
- typeName = factory.updateQualifiedName(
48217
- typeName,
48218
- typeName.left,
48219
- setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments)
48220
- );
48178
+ typeName = factory.updateQualifiedName(typeName, typeName.left, setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments));
48221
48179
  }
48222
48180
  }
48223
48181
  typeArguments = ref.typeArguments;
@@ -48774,7 +48732,9 @@ function createTypeChecker(host) {
48774
48732
  if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning2 : getQualifiedLeftMeaning(meaning2))) {
48775
48733
  const parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol2, context.enclosingDeclaration, meaning2);
48776
48734
  if (length(parents)) {
48777
- parentSpecifiers = parents.map((symbol3) => some(symbol3.declarations, hasNonGlobalAugmentationExternalModuleSymbol) ? getSpecifierForModuleSymbol(symbol3, context) : void 0);
48735
+ parentSpecifiers = parents.map(
48736
+ (symbol3) => some(symbol3.declarations, hasNonGlobalAugmentationExternalModuleSymbol) ? getSpecifierForModuleSymbol(symbol3, context) : void 0
48737
+ );
48778
48738
  const indices = parents.map((_, i) => i);
48779
48739
  indices.sort(sortByBestName);
48780
48740
  const sortedParents = indices.map((i) => parents[i]);
@@ -49555,7 +49515,11 @@ function createTypeChecker(host) {
49555
49515
  if (accessibleResult.accessibility === 0 /* Accessible */) {
49556
49516
  const chain = lookupSymbolChainWorker(sym, context, meaning);
49557
49517
  if (!(sym.flags & 4 /* Property */)) {
49558
- includePrivateSymbol(chain[0]);
49518
+ const root = chain[0];
49519
+ const contextFile = getSourceFileOfNode(oldcontext.enclosingDeclaration);
49520
+ if (some(root.declarations, (d) => getSourceFileOfNode(d) === contextFile)) {
49521
+ includePrivateSymbol(root);
49522
+ }
49559
49523
  }
49560
49524
  } else if ((_a = oldcontext.tracker.inner) == null ? void 0 : _a.trackSymbol) {
49561
49525
  return oldcontext.tracker.inner.trackSymbol(sym, decl, meaning);
@@ -49600,21 +49564,24 @@ function createTypeChecker(host) {
49600
49564
  ns.name,
49601
49565
  body = factory.updateModuleBlock(
49602
49566
  body,
49603
- factory.createNodeArray([...ns.body.statements, factory.createExportDeclaration(
49604
- /*modifiers*/
49605
- void 0,
49606
- /*isTypeOnly*/
49607
- false,
49608
- factory.createNamedExports(map(flatMap(excessExports, (e) => getNamesOfDeclaration(e)), (id) => factory.createExportSpecifier(
49567
+ factory.createNodeArray([
49568
+ ...ns.body.statements,
49569
+ factory.createExportDeclaration(
49570
+ /*modifiers*/
49571
+ void 0,
49609
49572
  /*isTypeOnly*/
49610
49573
  false,
49611
- /*propertyName*/
49612
- void 0,
49613
- id
49614
- ))),
49615
- /*moduleSpecifier*/
49616
- void 0
49617
- )])
49574
+ factory.createNamedExports(map(flatMap(excessExports, (e) => getNamesOfDeclaration(e)), (id) => factory.createExportSpecifier(
49575
+ /*isTypeOnly*/
49576
+ false,
49577
+ /*propertyName*/
49578
+ void 0,
49579
+ id
49580
+ ))),
49581
+ /*moduleSpecifier*/
49582
+ void 0
49583
+ )
49584
+ ])
49618
49585
  )
49619
49586
  );
49620
49587
  statements = [...statements.slice(0, nsIndex), ns, ...statements.slice(nsIndex + 1)];
@@ -49634,15 +49601,18 @@ function createTypeChecker(host) {
49634
49601
  const exports = filter(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause));
49635
49602
  if (length(exports) > 1) {
49636
49603
  const nonExports = filter(statements, (d) => !isExportDeclaration(d) || !!d.moduleSpecifier || !d.exportClause);
49637
- statements = [...nonExports, factory.createExportDeclaration(
49638
- /*modifiers*/
49639
- void 0,
49640
- /*isTypeOnly*/
49641
- false,
49642
- factory.createNamedExports(flatMap(exports, (e) => cast(e.exportClause, isNamedExports).elements)),
49643
- /*moduleSpecifier*/
49644
- void 0
49645
- )];
49604
+ statements = [
49605
+ ...nonExports,
49606
+ factory.createExportDeclaration(
49607
+ /*modifiers*/
49608
+ void 0,
49609
+ /*isTypeOnly*/
49610
+ false,
49611
+ factory.createNamedExports(flatMap(exports, (e) => cast(e.exportClause, isNamedExports).elements)),
49612
+ /*moduleSpecifier*/
49613
+ void 0
49614
+ )
49615
+ ];
49646
49616
  }
49647
49617
  const reexports = filter(statements, (d) => isExportDeclaration(d) && !!d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause));
49648
49618
  if (length(reexports) > 1) {
@@ -49821,18 +49791,21 @@ function createTypeChecker(host) {
49821
49791
  );
49822
49792
  context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */);
49823
49793
  } else {
49824
- const statement = setTextRange(factory.createVariableStatement(
49825
- /*modifiers*/
49826
- void 0,
49827
- factory.createVariableDeclarationList([
49828
- factory.createVariableDeclaration(
49829
- name,
49830
- /*exclamationToken*/
49831
- void 0,
49832
- serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
49833
- )
49834
- ], flags)
49835
- ), textRange);
49794
+ const statement = setTextRange(
49795
+ factory.createVariableStatement(
49796
+ /*modifiers*/
49797
+ void 0,
49798
+ factory.createVariableDeclarationList([
49799
+ factory.createVariableDeclaration(
49800
+ name,
49801
+ /*exclamationToken*/
49802
+ void 0,
49803
+ serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
49804
+ )
49805
+ ], flags)
49806
+ ),
49807
+ textRange
49808
+ );
49836
49809
  addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags);
49837
49810
  if (name !== localName && !isPrivate) {
49838
49811
  addResult(
@@ -49906,18 +49879,21 @@ function createTypeChecker(host) {
49906
49879
  factory.createIdentifier(getInternalSymbolName(symbol, symbolName2))
49907
49880
  ), 0 /* None */);
49908
49881
  } else if (needsExportDeclaration) {
49909
- addResult(factory.createExportDeclaration(
49910
- /*modifiers*/
49911
- void 0,
49912
- /*isTypeOnly*/
49913
- false,
49914
- factory.createNamedExports([factory.createExportSpecifier(
49882
+ addResult(
49883
+ factory.createExportDeclaration(
49884
+ /*modifiers*/
49885
+ void 0,
49915
49886
  /*isTypeOnly*/
49916
49887
  false,
49917
- getInternalSymbolName(symbol, symbolName2),
49918
- symbolName2
49919
- )])
49920
- ), 0 /* None */);
49888
+ factory.createNamedExports([factory.createExportSpecifier(
49889
+ /*isTypeOnly*/
49890
+ false,
49891
+ getInternalSymbolName(symbol, symbolName2),
49892
+ symbolName2
49893
+ )])
49894
+ ),
49895
+ 0 /* None */
49896
+ );
49921
49897
  }
49922
49898
  }
49923
49899
  function includePrivateSymbol(symbol) {
@@ -49925,10 +49901,7 @@ function createTypeChecker(host) {
49925
49901
  return;
49926
49902
  Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]);
49927
49903
  getUnusedName(unescapeLeadingUnderscores(symbol.escapedName), symbol);
49928
- const isExternalImportAlias = !!(symbol.flags & 2097152 /* Alias */) && !some(
49929
- symbol.declarations,
49930
- (d) => !!findAncestor(d, isExportDeclaration) || isNamespaceExport(d) || isImportEqualsDeclaration(d) && !isExternalModuleReference(d.moduleReference)
49931
- );
49904
+ const isExternalImportAlias = !!(symbol.flags & 2097152 /* Alias */) && !some(symbol.declarations, (d) => !!findAncestor(d, isExportDeclaration) || isNamespaceExport(d) || isImportEqualsDeclaration(d) && !isExternalModuleReference(d.moduleReference));
49932
49905
  deferredPrivatesStack[isExternalImportAlias ? 0 : deferredPrivatesStack.length - 1].set(getSymbolId(symbol), symbol);
49933
49906
  }
49934
49907
  function isExportingScope(enclosingDeclaration2) {
@@ -49965,16 +49938,19 @@ function createTypeChecker(host) {
49965
49938
  const oldEnclosingDecl = context.enclosingDeclaration;
49966
49939
  context.enclosingDeclaration = jsdocAliasDecl;
49967
49940
  const typeNode = jsdocAliasDecl && jsdocAliasDecl.typeExpression && isJSDocTypeExpression(jsdocAliasDecl.typeExpression) && serializeExistingTypeNode(context, jsdocAliasDecl.typeExpression.type, includePrivateSymbol, bundled) || typeToTypeNodeHelper(aliasType, context);
49968
- addResult(setSyntheticLeadingComments(
49969
- factory.createTypeAliasDeclaration(
49970
- /*modifiers*/
49971
- void 0,
49972
- getInternalSymbolName(symbol, symbolName2),
49973
- typeParamDecls,
49974
- typeNode
49941
+ addResult(
49942
+ setSyntheticLeadingComments(
49943
+ factory.createTypeAliasDeclaration(
49944
+ /*modifiers*/
49945
+ void 0,
49946
+ getInternalSymbolName(symbol, symbolName2),
49947
+ typeParamDecls,
49948
+ typeNode
49949
+ ),
49950
+ !commentText ? [] : [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]
49975
49951
  ),
49976
- !commentText ? [] : [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]
49977
- ), modifierFlags);
49952
+ modifierFlags
49953
+ );
49978
49954
  context.flags = oldFlags;
49979
49955
  context.enclosingDeclaration = oldEnclosingDecl;
49980
49956
  }
@@ -49989,14 +49965,17 @@ function createTypeChecker(host) {
49989
49965
  const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 180 /* ConstructSignature */);
49990
49966
  const indexSignatures = serializeIndexSignatures(interfaceType, baseType);
49991
49967
  const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(96 /* ExtendsKeyword */, mapDefined(baseTypes, (b) => trySerializeAsTypeReference(b, 111551 /* Value */)))];
49992
- addResult(factory.createInterfaceDeclaration(
49993
- /*modifiers*/
49994
- void 0,
49995
- getInternalSymbolName(symbol, symbolName2),
49996
- typeParamDecls,
49997
- heritageClauses,
49998
- [...indexSignatures, ...constructSignatures, ...callSignatures, ...members]
49999
- ), modifierFlags);
49968
+ addResult(
49969
+ factory.createInterfaceDeclaration(
49970
+ /*modifiers*/
49971
+ void 0,
49972
+ getInternalSymbolName(symbol, symbolName2),
49973
+ typeParamDecls,
49974
+ heritageClauses,
49975
+ [...indexSignatures, ...constructSignatures, ...callSignatures, ...members]
49976
+ ),
49977
+ modifierFlags
49978
+ );
50000
49979
  }
50001
49980
  function getNamespaceMembersForSerialization(symbol) {
50002
49981
  const exports = getExportsOfSymbol(symbol);
@@ -50046,24 +50025,33 @@ function createTypeChecker(host) {
50046
50025
  );
50047
50026
  }))
50048
50027
  )]);
50049
- addResult(factory.createModuleDeclaration(
50050
- /*modifiers*/
50051
- void 0,
50052
- factory.createIdentifier(localName),
50053
- nsBody,
50054
- 32 /* Namespace */
50055
- ), 0 /* None */);
50028
+ addResult(
50029
+ factory.createModuleDeclaration(
50030
+ /*modifiers*/
50031
+ void 0,
50032
+ factory.createIdentifier(localName),
50033
+ nsBody,
50034
+ 32 /* Namespace */
50035
+ ),
50036
+ 0 /* None */
50037
+ );
50056
50038
  }
50057
50039
  }
50058
50040
  function serializeEnum(symbol, symbolName2, modifierFlags) {
50059
- addResult(factory.createEnumDeclaration(
50060
- factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 2048 /* Const */ : 0),
50061
- getInternalSymbolName(symbol, symbolName2),
50062
- map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => {
50063
- const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0;
50064
- return factory.createEnumMember(unescapeLeadingUnderscores(p.escapedName), initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue));
50065
- })
50066
- ), modifierFlags);
50041
+ addResult(
50042
+ factory.createEnumDeclaration(
50043
+ factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 2048 /* Const */ : 0),
50044
+ getInternalSymbolName(symbol, symbolName2),
50045
+ map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => {
50046
+ const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0;
50047
+ return factory.createEnumMember(
50048
+ unescapeLeadingUnderscores(p.escapedName),
50049
+ initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue)
50050
+ );
50051
+ })
50052
+ ),
50053
+ modifierFlags
50054
+ );
50067
50055
  }
50068
50056
  function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) {
50069
50057
  const signatures = getSignaturesOfType(type, 0 /* Call */);
@@ -50095,13 +50083,7 @@ function createTypeChecker(host) {
50095
50083
  }
50096
50084
  function serializeAsNamespaceDeclaration(props, localName, modifierFlags, suppressNewPrivateContext) {
50097
50085
  if (length(props)) {
50098
- const localVsRemoteMap = arrayToMultiMap(
50099
- props,
50100
- (p) => !length(p.declarations) || some(
50101
- p.declarations,
50102
- (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)
50103
- ) ? "local" : "remote"
50104
- );
50086
+ const localVsRemoteMap = arrayToMultiMap(props, (p) => !length(p.declarations) || some(p.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)) ? "local" : "remote");
50105
50087
  const localProps = localVsRemoteMap.get("local") || emptyArray;
50106
50088
  let fakespace = parseNodeFactory.createModuleDeclaration(
50107
50089
  /*modifiers*/
@@ -50178,10 +50160,7 @@ function createTypeChecker(host) {
50178
50160
  }
50179
50161
  return cleanup(factory.createExpressionWithTypeArguments(
50180
50162
  expr,
50181
- map(
50182
- e.typeArguments,
50183
- (a) => serializeExistingTypeNode(context, a, includePrivateSymbol, bundled) || typeToTypeNodeHelper(getTypeFromTypeNode(a), context)
50184
- )
50163
+ map(e.typeArguments, (a) => serializeExistingTypeNode(context, a, includePrivateSymbol, bundled) || typeToTypeNodeHelper(getTypeFromTypeNode(a), context))
50185
50164
  ));
50186
50165
  function cleanup(result2) {
50187
50166
  context.enclosingDeclaration = oldEnclosing;
@@ -50255,14 +50234,20 @@ function createTypeChecker(host) {
50255
50234
  )] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 176 /* Constructor */);
50256
50235
  const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
50257
50236
  context.enclosingDeclaration = oldEnclosing;
50258
- addResult(setTextRange(factory.createClassDeclaration(
50259
- /*modifiers*/
50260
- void 0,
50261
- localName,
50262
- typeParamDecls,
50263
- heritageClauses,
50264
- [...indexSignatures, ...staticMembers, ...constructors, ...publicProperties, ...privateProperties]
50265
- ), symbol.declarations && filter(symbol.declarations, (d) => isClassDeclaration(d) || isClassExpression(d))[0]), modifierFlags);
50237
+ addResult(
50238
+ setTextRange(
50239
+ factory.createClassDeclaration(
50240
+ /*modifiers*/
50241
+ void 0,
50242
+ localName,
50243
+ typeParamDecls,
50244
+ heritageClauses,
50245
+ [...indexSignatures, ...staticMembers, ...constructors, ...publicProperties, ...privateProperties]
50246
+ ),
50247
+ symbol.declarations && filter(symbol.declarations, (d) => isClassDeclaration(d) || isClassExpression(d))[0]
50248
+ ),
50249
+ modifierFlags
50250
+ );
50266
50251
  }
50267
50252
  function getSomeTargetNameFromDeclarations(declarations) {
50268
50253
  return firstDefined(declarations, (d) => {
@@ -50308,25 +50293,28 @@ function createTypeChecker(host) {
50308
50293
  if (((_b = (_a = node.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) {
50309
50294
  const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
50310
50295
  const { propertyName } = node;
50311
- addResult(factory.createImportDeclaration(
50312
- /*modifiers*/
50313
- void 0,
50314
- factory.createImportClause(
50315
- /*isTypeOnly*/
50316
- false,
50317
- /*name*/
50296
+ addResult(
50297
+ factory.createImportDeclaration(
50298
+ /*modifiers*/
50318
50299
  void 0,
50319
- factory.createNamedImports([factory.createImportSpecifier(
50300
+ factory.createImportClause(
50320
50301
  /*isTypeOnly*/
50321
50302
  false,
50322
- propertyName && isIdentifier(propertyName) ? factory.createIdentifier(idText(propertyName)) : void 0,
50323
- factory.createIdentifier(localName)
50324
- )])
50303
+ /*name*/
50304
+ void 0,
50305
+ factory.createNamedImports([factory.createImportSpecifier(
50306
+ /*isTypeOnly*/
50307
+ false,
50308
+ propertyName && isIdentifier(propertyName) ? factory.createIdentifier(idText(propertyName)) : void 0,
50309
+ factory.createIdentifier(localName)
50310
+ )])
50311
+ ),
50312
+ factory.createStringLiteral(specifier2),
50313
+ /*assertClause*/
50314
+ void 0
50325
50315
  ),
50326
- factory.createStringLiteral(specifier2),
50327
- /*assertClause*/
50328
- void 0
50329
- ), 0 /* None */);
50316
+ 0 /* None */
50317
+ );
50330
50318
  break;
50331
50319
  }
50332
50320
  Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
@@ -50344,22 +50332,28 @@ function createTypeChecker(host) {
50344
50332
  const initializer = node.initializer;
50345
50333
  const uniqueName = factory.createUniqueName(localName);
50346
50334
  const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
50347
- addResult(factory.createImportEqualsDeclaration(
50348
- /*modifiers*/
50349
- void 0,
50350
- /*isTypeOnly*/
50351
- false,
50352
- uniqueName,
50353
- factory.createExternalModuleReference(factory.createStringLiteral(specifier2))
50354
- ), 0 /* None */);
50355
- addResult(factory.createImportEqualsDeclaration(
50356
- /*modifiers*/
50357
- void 0,
50358
- /*isTypeOnly*/
50359
- false,
50360
- factory.createIdentifier(localName),
50361
- factory.createQualifiedName(uniqueName, initializer.name)
50362
- ), modifierFlags);
50335
+ addResult(
50336
+ factory.createImportEqualsDeclaration(
50337
+ /*modifiers*/
50338
+ void 0,
50339
+ /*isTypeOnly*/
50340
+ false,
50341
+ uniqueName,
50342
+ factory.createExternalModuleReference(factory.createStringLiteral(specifier2))
50343
+ ),
50344
+ 0 /* None */
50345
+ );
50346
+ addResult(
50347
+ factory.createImportEqualsDeclaration(
50348
+ /*modifiers*/
50349
+ void 0,
50350
+ /*isTypeOnly*/
50351
+ false,
50352
+ factory.createIdentifier(localName),
50353
+ factory.createQualifiedName(uniqueName, initializer.name)
50354
+ ),
50355
+ modifierFlags
50356
+ );
50363
50357
  break;
50364
50358
  }
50365
50359
  case 271 /* ImportEqualsDeclaration */:
@@ -50368,20 +50362,23 @@ function createTypeChecker(host) {
50368
50362
  break;
50369
50363
  }
50370
50364
  const isLocalImport = !(target.flags & 512 /* ValueModule */) && !isVariableDeclaration(node);
50371
- addResult(factory.createImportEqualsDeclaration(
50372
- /*modifiers*/
50373
- void 0,
50374
- /*isTypeOnly*/
50375
- false,
50376
- factory.createIdentifier(localName),
50377
- isLocalImport ? symbolToName(
50378
- target,
50379
- context,
50380
- 67108863 /* All */,
50381
- /*expectsIdentifier*/
50382
- false
50383
- ) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))
50384
- ), isLocalImport ? modifierFlags : 0 /* None */);
50365
+ addResult(
50366
+ factory.createImportEqualsDeclaration(
50367
+ /*modifiers*/
50368
+ void 0,
50369
+ /*isTypeOnly*/
50370
+ false,
50371
+ factory.createIdentifier(localName),
50372
+ isLocalImport ? symbolToName(
50373
+ target,
50374
+ context,
50375
+ 67108863 /* All */,
50376
+ /*expectsIdentifier*/
50377
+ false
50378
+ ) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))
50379
+ ),
50380
+ isLocalImport ? modifierFlags : 0 /* None */
50381
+ );
50385
50382
  break;
50386
50383
  case 270 /* NamespaceExportDeclaration */:
50387
50384
  addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */);
@@ -50389,72 +50386,84 @@ function createTypeChecker(host) {
50389
50386
  case 273 /* ImportClause */: {
50390
50387
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
50391
50388
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier;
50392
- addResult(factory.createImportDeclaration(
50393
- /*modifiers*/
50394
- void 0,
50395
- factory.createImportClause(
50396
- /*isTypeOnly*/
50397
- false,
50398
- factory.createIdentifier(localName),
50399
- /*namedBindings*/
50400
- void 0
50389
+ addResult(
50390
+ factory.createImportDeclaration(
50391
+ /*modifiers*/
50392
+ void 0,
50393
+ factory.createImportClause(
50394
+ /*isTypeOnly*/
50395
+ false,
50396
+ factory.createIdentifier(localName),
50397
+ /*namedBindings*/
50398
+ void 0
50399
+ ),
50400
+ specifier2,
50401
+ node.parent.assertClause
50401
50402
  ),
50402
- specifier2,
50403
- node.parent.assertClause
50404
- ), 0 /* None */);
50403
+ 0 /* None */
50404
+ );
50405
50405
  break;
50406
50406
  }
50407
50407
  case 274 /* NamespaceImport */: {
50408
50408
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
50409
50409
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier;
50410
- addResult(factory.createImportDeclaration(
50411
- /*modifiers*/
50412
- void 0,
50413
- factory.createImportClause(
50414
- /*isTypeOnly*/
50415
- false,
50416
- /*name*/
50410
+ addResult(
50411
+ factory.createImportDeclaration(
50412
+ /*modifiers*/
50417
50413
  void 0,
50418
- factory.createNamespaceImport(factory.createIdentifier(localName))
50414
+ factory.createImportClause(
50415
+ /*isTypeOnly*/
50416
+ false,
50417
+ /*name*/
50418
+ void 0,
50419
+ factory.createNamespaceImport(factory.createIdentifier(localName))
50420
+ ),
50421
+ specifier2,
50422
+ node.parent.parent.assertClause
50419
50423
  ),
50420
- specifier2,
50421
- node.parent.parent.assertClause
50422
- ), 0 /* None */);
50424
+ 0 /* None */
50425
+ );
50423
50426
  break;
50424
50427
  }
50425
50428
  case 280 /* NamespaceExport */:
50426
- addResult(factory.createExportDeclaration(
50427
- /*modifiers*/
50428
- void 0,
50429
- /*isTypeOnly*/
50430
- false,
50431
- factory.createNamespaceExport(factory.createIdentifier(localName)),
50432
- factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))
50433
- ), 0 /* None */);
50429
+ addResult(
50430
+ factory.createExportDeclaration(
50431
+ /*modifiers*/
50432
+ void 0,
50433
+ /*isTypeOnly*/
50434
+ false,
50435
+ factory.createNamespaceExport(factory.createIdentifier(localName)),
50436
+ factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))
50437
+ ),
50438
+ 0 /* None */
50439
+ );
50434
50440
  break;
50435
50441
  case 276 /* ImportSpecifier */: {
50436
50442
  const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
50437
50443
  const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier;
50438
- addResult(factory.createImportDeclaration(
50439
- /*modifiers*/
50440
- void 0,
50441
- factory.createImportClause(
50442
- /*isTypeOnly*/
50443
- false,
50444
- /*name*/
50444
+ addResult(
50445
+ factory.createImportDeclaration(
50446
+ /*modifiers*/
50445
50447
  void 0,
50446
- factory.createNamedImports([
50447
- factory.createImportSpecifier(
50448
- /*isTypeOnly*/
50449
- false,
50450
- localName !== verbatimTargetName ? factory.createIdentifier(verbatimTargetName) : void 0,
50451
- factory.createIdentifier(localName)
50452
- )
50453
- ])
50448
+ factory.createImportClause(
50449
+ /*isTypeOnly*/
50450
+ false,
50451
+ /*name*/
50452
+ void 0,
50453
+ factory.createNamedImports([
50454
+ factory.createImportSpecifier(
50455
+ /*isTypeOnly*/
50456
+ false,
50457
+ localName !== verbatimTargetName ? factory.createIdentifier(verbatimTargetName) : void 0,
50458
+ factory.createIdentifier(localName)
50459
+ )
50460
+ ])
50461
+ ),
50462
+ specifier2,
50463
+ node.parent.parent.parent.assertClause
50454
50464
  ),
50455
- specifier2,
50456
- node.parent.parent.parent.assertClause
50457
- ), 0 /* None */);
50465
+ 0 /* None */
50466
+ );
50458
50467
  break;
50459
50468
  }
50460
50469
  case 281 /* ExportSpecifier */:
@@ -50482,19 +50491,22 @@ function createTypeChecker(host) {
50482
50491
  }
50483
50492
  }
50484
50493
  function serializeExportSpecifier(localName, targetName, specifier) {
50485
- addResult(factory.createExportDeclaration(
50486
- /*modifiers*/
50487
- void 0,
50488
- /*isTypeOnly*/
50489
- false,
50490
- factory.createNamedExports([factory.createExportSpecifier(
50494
+ addResult(
50495
+ factory.createExportDeclaration(
50496
+ /*modifiers*/
50497
+ void 0,
50491
50498
  /*isTypeOnly*/
50492
50499
  false,
50493
- localName !== targetName ? targetName : void 0,
50494
- localName
50495
- )]),
50496
- specifier
50497
- ), 0 /* None */);
50500
+ factory.createNamedExports([factory.createExportSpecifier(
50501
+ /*isTypeOnly*/
50502
+ false,
50503
+ localName !== targetName ? targetName : void 0,
50504
+ localName
50505
+ )]),
50506
+ specifier
50507
+ ),
50508
+ 0 /* None */
50509
+ );
50498
50510
  }
50499
50511
  function serializeMaybeAliasAssignment(symbol) {
50500
50512
  var _a;
@@ -50542,20 +50554,23 @@ function createTypeChecker(host) {
50542
50554
  serializeExportSpecifier(name, getInternalSymbolName(target, symbolName(target)));
50543
50555
  } else {
50544
50556
  const varName = getUnusedName(name, symbol);
50545
- addResult(factory.createImportEqualsDeclaration(
50546
- /*modifiers*/
50547
- void 0,
50548
- /*isTypeOnly*/
50549
- false,
50550
- factory.createIdentifier(varName),
50551
- symbolToName(
50552
- target,
50553
- context,
50554
- 67108863 /* All */,
50555
- /*expectsIdentifier*/
50556
- false
50557
- )
50558
- ), 0 /* None */);
50557
+ addResult(
50558
+ factory.createImportEqualsDeclaration(
50559
+ /*modifiers*/
50560
+ void 0,
50561
+ /*isTypeOnly*/
50562
+ false,
50563
+ factory.createIdentifier(varName),
50564
+ symbolToName(
50565
+ target,
50566
+ context,
50567
+ 67108863 /* All */,
50568
+ /*expectsIdentifier*/
50569
+ false
50570
+ )
50571
+ ),
50572
+ 0 /* None */
50573
+ );
50559
50574
  serializeExportSpecifier(name, varName);
50560
50575
  }
50561
50576
  }
@@ -50622,60 +50637,72 @@ function createTypeChecker(host) {
50622
50637
  if (p.flags & 98304 /* Accessor */ && useAccessors) {
50623
50638
  const result = [];
50624
50639
  if (p.flags & 65536 /* SetAccessor */) {
50625
- result.push(setTextRange(factory.createSetAccessorDeclaration(
50626
- factory.createModifiersFromModifierFlags(flag),
50627
- name,
50628
- [factory.createParameterDeclaration(
50629
- /*modifiers*/
50630
- void 0,
50631
- /*dotDotDotToken*/
50632
- void 0,
50633
- "arg",
50634
- /*questionToken*/
50635
- void 0,
50636
- isPrivate ? void 0 : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled)
50637
- )],
50638
- /*body*/
50639
- void 0
50640
- ), ((_b = p.declarations) == null ? void 0 : _b.find(isSetAccessor)) || firstPropertyLikeDecl));
50640
+ result.push(setTextRange(
50641
+ factory.createSetAccessorDeclaration(
50642
+ factory.createModifiersFromModifierFlags(flag),
50643
+ name,
50644
+ [factory.createParameterDeclaration(
50645
+ /*modifiers*/
50646
+ void 0,
50647
+ /*dotDotDotToken*/
50648
+ void 0,
50649
+ "arg",
50650
+ /*questionToken*/
50651
+ void 0,
50652
+ isPrivate ? void 0 : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled)
50653
+ )],
50654
+ /*body*/
50655
+ void 0
50656
+ ),
50657
+ ((_b = p.declarations) == null ? void 0 : _b.find(isSetAccessor)) || firstPropertyLikeDecl
50658
+ ));
50641
50659
  }
50642
50660
  if (p.flags & 32768 /* GetAccessor */) {
50643
50661
  const isPrivate2 = modifierFlags & 8 /* Private */;
50644
- result.push(setTextRange(factory.createGetAccessorDeclaration(
50645
- factory.createModifiersFromModifierFlags(flag),
50646
- name,
50647
- [],
50648
- isPrivate2 ? void 0 : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
50649
- /*body*/
50650
- void 0
50651
- ), ((_c = p.declarations) == null ? void 0 : _c.find(isGetAccessor)) || firstPropertyLikeDecl));
50662
+ result.push(setTextRange(
50663
+ factory.createGetAccessorDeclaration(
50664
+ factory.createModifiersFromModifierFlags(flag),
50665
+ name,
50666
+ [],
50667
+ isPrivate2 ? void 0 : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
50668
+ /*body*/
50669
+ void 0
50670
+ ),
50671
+ ((_c = p.declarations) == null ? void 0 : _c.find(isGetAccessor)) || firstPropertyLikeDecl
50672
+ ));
50652
50673
  }
50653
50674
  return result;
50654
50675
  } else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {
50655
- return setTextRange(createProperty2(
50656
- factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag),
50657
- name,
50658
- p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
50659
- isPrivate ? void 0 : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
50660
- // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357
50661
- // interface members can't have initializers, however class members _can_
50662
- /*initializer*/
50663
- void 0
50664
- ), ((_d = p.declarations) == null ? void 0 : _d.find(or(isPropertyDeclaration, isVariableDeclaration))) || firstPropertyLikeDecl);
50665
- }
50666
- if (p.flags & (8192 /* Method */ | 16 /* Function */)) {
50667
- const type = getTypeOfSymbol(p);
50668
- const signatures = getSignaturesOfType(type, 0 /* Call */);
50669
- if (flag & 8 /* Private */) {
50670
- return setTextRange(createProperty2(
50676
+ return setTextRange(
50677
+ createProperty2(
50671
50678
  factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag),
50672
50679
  name,
50673
50680
  p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
50674
- /*type*/
50675
- void 0,
50681
+ isPrivate ? void 0 : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
50682
+ // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357
50683
+ // interface members can't have initializers, however class members _can_
50676
50684
  /*initializer*/
50677
50685
  void 0
50678
- ), ((_e = p.declarations) == null ? void 0 : _e.find(isFunctionLikeDeclaration)) || signatures[0] && signatures[0].declaration || p.declarations && p.declarations[0]);
50686
+ ),
50687
+ ((_d = p.declarations) == null ? void 0 : _d.find(or(isPropertyDeclaration, isVariableDeclaration))) || firstPropertyLikeDecl
50688
+ );
50689
+ }
50690
+ if (p.flags & (8192 /* Method */ | 16 /* Function */)) {
50691
+ const type = getTypeOfSymbol(p);
50692
+ const signatures = getSignaturesOfType(type, 0 /* Call */);
50693
+ if (flag & 8 /* Private */) {
50694
+ return setTextRange(
50695
+ createProperty2(
50696
+ factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag),
50697
+ name,
50698
+ p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
50699
+ /*type*/
50700
+ void 0,
50701
+ /*initializer*/
50702
+ void 0
50703
+ ),
50704
+ ((_e = p.declarations) == null ? void 0 : _e.find(isFunctionLikeDeclaration)) || signatures[0] && signatures[0].declaration || p.declarations && p.declarations[0]
50705
+ );
50679
50706
  }
50680
50707
  const results2 = [];
50681
50708
  for (const sig of signatures) {
@@ -50746,13 +50773,16 @@ function createTypeChecker(host) {
50746
50773
  }
50747
50774
  }
50748
50775
  if (privateProtected) {
50749
- return [setTextRange(factory.createConstructorDeclaration(
50750
- factory.createModifiersFromModifierFlags(privateProtected),
50751
- /*parameters*/
50752
- [],
50753
- /*body*/
50754
- void 0
50755
- ), signatures[0].declaration)];
50776
+ return [setTextRange(
50777
+ factory.createConstructorDeclaration(
50778
+ factory.createModifiersFromModifierFlags(privateProtected),
50779
+ /*parameters*/
50780
+ [],
50781
+ /*body*/
50782
+ void 0
50783
+ ),
50784
+ signatures[0].declaration
50785
+ )];
50756
50786
  }
50757
50787
  }
50758
50788
  const results2 = [];
@@ -52290,19 +52320,11 @@ function createTypeChecker(host) {
52290
52320
  function reportCircularityError(symbol) {
52291
52321
  const declaration = symbol.valueDeclaration;
52292
52322
  if (getEffectiveTypeAnnotationNode(declaration)) {
52293
- error(
52294
- symbol.valueDeclaration,
52295
- Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,
52296
- symbolToString(symbol)
52297
- );
52323
+ error(symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
52298
52324
  return errorType;
52299
52325
  }
52300
52326
  if (noImplicitAny && (declaration.kind !== 169 /* Parameter */ || declaration.initializer)) {
52301
- error(
52302
- symbol.valueDeclaration,
52303
- Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,
52304
- symbolToString(symbol)
52305
- );
52327
+ error(symbol.valueDeclaration, Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol));
52306
52328
  }
52307
52329
  return anyType;
52308
52330
  }
@@ -52513,10 +52535,7 @@ function createTypeChecker(host) {
52513
52535
  function getConstructorsForTypeArguments(type, typeArgumentNodes, location) {
52514
52536
  const typeArgCount = length(typeArgumentNodes);
52515
52537
  const isJavascript = isInJSFile(location);
52516
- return filter(
52517
- getSignaturesOfType(type, 1 /* Construct */),
52518
- (sig) => (isJavascript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= length(sig.typeParameters)
52519
- );
52538
+ return filter(getSignaturesOfType(type, 1 /* Construct */), (sig) => (isJavascript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= length(sig.typeParameters));
52520
52539
  }
52521
52540
  function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) {
52522
52541
  const signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location);
@@ -52663,16 +52682,12 @@ function createTypeChecker(host) {
52663
52682
  return type.resolvedBaseTypes = emptyArray;
52664
52683
  }
52665
52684
  if (type === reducedBaseType || hasBaseType(reducedBaseType, type)) {
52666
- error(
52667
- type.symbol.valueDeclaration,
52668
- Diagnostics.Type_0_recursively_references_itself_as_a_base_type,
52669
- typeToString(
52670
- type,
52671
- /*enclosingDeclaration*/
52672
- void 0,
52673
- 2 /* WriteArrayAsGenericType */
52674
- )
52675
- );
52685
+ error(type.symbol.valueDeclaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(
52686
+ type,
52687
+ /*enclosingDeclaration*/
52688
+ void 0,
52689
+ 2 /* WriteArrayAsGenericType */
52690
+ ));
52676
52691
  return type.resolvedBaseTypes = emptyArray;
52677
52692
  }
52678
52693
  if (type.resolvedBaseTypes === resolvingEmptyArray) {
@@ -52826,7 +52841,9 @@ function createTypeChecker(host) {
52826
52841
  if (hasBindableName(member)) {
52827
52842
  const memberSymbol = getSymbolOfDeclaration(member);
52828
52843
  const value = getEnumMemberValue(member);
52829
- const memberType = getFreshTypeOfLiteralType(value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol));
52844
+ const memberType = getFreshTypeOfLiteralType(
52845
+ value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol)
52846
+ );
52830
52847
  getSymbolLinks(memberSymbol).declaredType = memberType;
52831
52848
  memberTypeList.push(getRegularTypeOfLiteralType(memberType));
52832
52849
  }
@@ -53234,10 +53251,7 @@ function createTypeChecker(host) {
53234
53251
  return signature.optionalCallSignatureCache[key] || (signature.optionalCallSignatureCache[key] = createOptionalCallSignature(signature, callChainFlags));
53235
53252
  }
53236
53253
  function createOptionalCallSignature(signature, callChainFlags) {
53237
- Debug.assert(
53238
- callChainFlags === 8 /* IsInnerCallChain */ || callChainFlags === 16 /* IsOuterCallChain */,
53239
- "An optional call signature can either be for an inner call chain or an outer call chain, but not both."
53240
- );
53254
+ Debug.assert(callChainFlags === 8 /* IsInnerCallChain */ || callChainFlags === 16 /* IsOuterCallChain */, "An optional call signature can either be for an inner call chain or an outer call chain, but not both.");
53241
53255
  const result = cloneSignature(signature);
53242
53256
  result.flags |= callChainFlags;
53243
53257
  return result;
@@ -53524,11 +53538,7 @@ function createTypeChecker(host) {
53524
53538
  for (const info of sourceInfos) {
53525
53539
  const indexType = info.keyType;
53526
53540
  if (every(types, (t) => !!getIndexInfoOfType(t, indexType))) {
53527
- result.push(createIndexInfo(
53528
- indexType,
53529
- getUnionType(map(types, (t) => getIndexTypeOfType(t, indexType))),
53530
- some(types, (t) => getIndexInfoOfType(t, indexType).isReadonly)
53531
- ));
53541
+ result.push(createIndexInfo(indexType, getUnionType(map(types, (t) => getIndexTypeOfType(t, indexType))), some(types, (t) => getIndexInfoOfType(t, indexType).isReadonly)));
53532
53542
  }
53533
53543
  }
53534
53544
  return result;
@@ -53620,11 +53630,7 @@ function createTypeChecker(host) {
53620
53630
  for (let i = 0; i < indexInfos.length; i++) {
53621
53631
  const info = indexInfos[i];
53622
53632
  if (info.keyType === newInfo.keyType) {
53623
- indexInfos[i] = createIndexInfo(
53624
- info.keyType,
53625
- union ? getUnionType([info.type, newInfo.type]) : getIntersectionType([info.type, newInfo.type]),
53626
- union ? info.isReadonly || newInfo.isReadonly : info.isReadonly && newInfo.isReadonly
53627
- );
53633
+ indexInfos[i] = createIndexInfo(info.keyType, union ? getUnionType([info.type, newInfo.type]) : getIntersectionType([info.type, newInfo.type]), union ? info.isReadonly || newInfo.isReadonly : info.isReadonly && newInfo.isReadonly);
53628
53634
  return indexInfos;
53629
53635
  }
53630
53636
  }
@@ -53704,20 +53710,23 @@ function createTypeChecker(host) {
53704
53710
  const classType = getDeclaredTypeOfClassOrInterface(symbol);
53705
53711
  let constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get("__constructor" /* Constructor */)) : emptyArray;
53706
53712
  if (symbol.flags & 16 /* Function */) {
53707
- constructSignatures = addRange(constructSignatures.slice(), mapDefined(
53708
- type.callSignatures,
53709
- (sig) => isJSConstructor(sig.declaration) ? createSignature(
53710
- sig.declaration,
53711
- sig.typeParameters,
53712
- sig.thisParameter,
53713
- sig.parameters,
53714
- classType,
53715
- /*resolvedTypePredicate*/
53716
- void 0,
53717
- sig.minArgumentCount,
53718
- sig.flags & 167 /* PropagatingFlags */
53719
- ) : void 0
53720
- ));
53713
+ constructSignatures = addRange(
53714
+ constructSignatures.slice(),
53715
+ mapDefined(
53716
+ type.callSignatures,
53717
+ (sig) => isJSConstructor(sig.declaration) ? createSignature(
53718
+ sig.declaration,
53719
+ sig.typeParameters,
53720
+ sig.thisParameter,
53721
+ sig.parameters,
53722
+ classType,
53723
+ /*resolvedTypePredicate*/
53724
+ void 0,
53725
+ sig.minArgumentCount,
53726
+ sig.flags & 167 /* PropagatingFlags */
53727
+ ) : void 0
53728
+ )
53729
+ );
53721
53730
  }
53722
53731
  if (!constructSignatures.length) {
53723
53732
  constructSignatures = getDefaultConstructSignatures(classType);
@@ -53839,11 +53848,7 @@ function createTypeChecker(host) {
53839
53848
  const isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || !(templateModifiers & 2 /* ExcludeReadonly */) && modifiersProp && isReadonlySymbol(modifiersProp));
53840
53849
  const stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */;
53841
53850
  const lateFlag = modifiersProp ? getIsLateCheckFlag(modifiersProp) : 0;
53842
- const prop = createSymbol(
53843
- 4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0),
53844
- propName,
53845
- lateFlag | 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)
53846
- );
53851
+ const prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, lateFlag | 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0));
53847
53852
  prop.links.mappedType = type;
53848
53853
  prop.links.nameType = propNameType;
53849
53854
  prop.links.keyType = keyType;
@@ -54564,31 +54569,21 @@ function createTypeChecker(host) {
54564
54569
  if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
54565
54570
  const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
54566
54571
  if (neverProp) {
54567
- return chainDiagnosticMessages(
54568
- errorInfo,
54569
- Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents,
54570
- typeToString(
54571
- type,
54572
- /*enclosingDeclaration*/
54573
- void 0,
54574
- 536870912 /* NoTypeReduction */
54575
- ),
54576
- symbolToString(neverProp)
54577
- );
54572
+ return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(
54573
+ type,
54574
+ /*enclosingDeclaration*/
54575
+ void 0,
54576
+ 536870912 /* NoTypeReduction */
54577
+ ), symbolToString(neverProp));
54578
54578
  }
54579
54579
  const privateProp = find(getPropertiesOfUnionOrIntersectionType(type), isConflictingPrivateProperty);
54580
54580
  if (privateProp) {
54581
- return chainDiagnosticMessages(
54582
- errorInfo,
54583
- Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some,
54584
- typeToString(
54585
- type,
54586
- /*enclosingDeclaration*/
54587
- void 0,
54588
- 536870912 /* NoTypeReduction */
54589
- ),
54590
- symbolToString(privateProp)
54591
- );
54581
+ return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some, typeToString(
54582
+ type,
54583
+ /*enclosingDeclaration*/
54584
+ void 0,
54585
+ 536870912 /* NoTypeReduction */
54586
+ ), symbolToString(privateProp));
54592
54587
  }
54593
54588
  }
54594
54589
  return errorInfo;
@@ -54673,16 +54668,12 @@ function createTypeChecker(host) {
54673
54668
  }
54674
54669
  }
54675
54670
  }
54676
- return applicableInfos ? createIndexInfo(
54677
- unknownType,
54678
- getIntersectionType(map(applicableInfos, (info) => info.type)),
54679
- reduceLeft(
54680
- applicableInfos,
54681
- (isReadonly, info) => isReadonly && info.isReadonly,
54682
- /*initial*/
54683
- true
54684
- )
54685
- ) : applicableInfo ? applicableInfo : stringIndexInfo && isApplicableIndexType(keyType, stringType) ? stringIndexInfo : void 0;
54671
+ return applicableInfos ? createIndexInfo(unknownType, getIntersectionType(map(applicableInfos, (info) => info.type)), reduceLeft(
54672
+ applicableInfos,
54673
+ (isReadonly, info) => isReadonly && info.isReadonly,
54674
+ /*initial*/
54675
+ true
54676
+ )) : applicableInfo ? applicableInfo : stringIndexInfo && isApplicableIndexType(keyType, stringType) ? stringIndexInfo : void 0;
54686
54677
  }
54687
54678
  function isApplicableIndexType(source, target) {
54688
54679
  return isTypeAssignableTo(source, target) || target === stringType && isTypeAssignableTo(source, numberType) || target === numberType && (source === numericStringType || !!(source.flags & 128 /* StringLiteral */) && isNumericLiteralName(source.value));
@@ -55034,12 +55025,7 @@ function createTypeChecker(host) {
55034
55025
  /*parameterIndex*/
55035
55026
  void 0,
55036
55027
  type
55037
- ) : createTypePredicate(
55038
- node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */,
55039
- parameterName.escapedText,
55040
- findIndex(signature.parameters, (p) => p.escapedName === parameterName.escapedText),
55041
- type
55042
- );
55028
+ ) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, findIndex(signature.parameters, (p) => p.escapedName === parameterName.escapedText), type);
55043
55029
  }
55044
55030
  function getUnionOrIntersectionType(types, kind, unionReduction) {
55045
55031
  return kind !== 2097152 /* Intersection */ ? getUnionType(types, unionReduction) : getIntersectionType(types);
@@ -55234,12 +55220,7 @@ function createTypeChecker(host) {
55234
55220
  if (parameter.type) {
55235
55221
  forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
55236
55222
  if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
55237
- indexInfos.push(createIndexInfo(
55238
- keyType,
55239
- declaration.type ? getTypeFromTypeNode(declaration.type) : anyType,
55240
- hasEffectiveModifier(declaration, 64 /* Readonly */),
55241
- declaration
55242
- ));
55223
+ indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 64 /* Readonly */), declaration));
55243
55224
  }
55244
55225
  });
55245
55226
  }
@@ -55270,9 +55251,12 @@ function createTypeChecker(host) {
55270
55251
  if (index < typeParameters.length) {
55271
55252
  const declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]);
55272
55253
  if (declaredConstraint) {
55273
- const mapper = makeDeferredTypeMapper(typeParameters, typeParameters.map((_, index2) => () => {
55274
- return getEffectiveTypeArgumentAtIndex(typeReference, typeParameters, index2);
55275
- }));
55254
+ const mapper = makeDeferredTypeMapper(
55255
+ typeParameters,
55256
+ typeParameters.map((_, index2) => () => {
55257
+ return getEffectiveTypeArgumentAtIndex(typeReference, typeParameters, index2);
55258
+ })
55259
+ );
55276
55260
  const constraint = instantiateType(declaredConstraint, mapper);
55277
55261
  if (constraint !== typeParameter) {
55278
55262
  inferences = append(inferences, constraint);
@@ -55289,10 +55273,7 @@ function createTypeChecker(host) {
55289
55273
  } else if (grandParent.kind === 200 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 194 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 200 /* MappedType */ && grandParent.parent.checkType.type) {
55290
55274
  const checkMappedType2 = grandParent.parent.checkType;
55291
55275
  const nodeType = getTypeFromTypeNode(checkMappedType2.type);
55292
- inferences = append(inferences, instantiateType(
55293
- nodeType,
55294
- makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(checkMappedType2.typeParameter)), checkMappedType2.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType2.typeParameter.constraint) : keyofConstraintType)
55295
- ));
55276
+ inferences = append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(checkMappedType2.typeParameter)), checkMappedType2.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType2.typeParameter.constraint) : keyofConstraintType)));
55296
55277
  }
55297
55278
  }
55298
55279
  }
@@ -55467,12 +55448,7 @@ function createTypeChecker(host) {
55467
55448
  const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
55468
55449
  let instantiation = links.instantiations.get(id);
55469
55450
  if (!instantiation) {
55470
- links.instantiations.set(id, instantiation = instantiateTypeWithAlias(
55471
- type,
55472
- createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))),
55473
- aliasSymbol,
55474
- aliasTypeArguments
55475
- ));
55451
+ links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
55476
55452
  }
55477
55453
  return instantiation;
55478
55454
  }
@@ -56308,11 +56284,7 @@ function createTypeChecker(host) {
56308
56284
  const flags = elementFlags[i];
56309
56285
  combinedFlags |= flags;
56310
56286
  if (!(combinedFlags & 12 /* Variable */)) {
56311
- const property = createSymbol(
56312
- 4 /* Property */ | (flags & 2 /* Optional */ ? 16777216 /* Optional */ : 0),
56313
- "" + i,
56314
- readonly ? 8 /* Readonly */ : 0
56315
- );
56287
+ const property = createSymbol(4 /* Property */ | (flags & 2 /* Optional */ ? 16777216 /* Optional */ : 0), "" + i, readonly ? 8 /* Readonly */ : 0);
56316
56288
  property.links.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i];
56317
56289
  property.links.type = typeParameter;
56318
56290
  properties.push(property);
@@ -56383,7 +56355,10 @@ function createTypeChecker(host) {
56383
56355
  } else if (isTupleType(type)) {
56384
56356
  const elements = getElementTypes(type);
56385
56357
  if (elements.length + expandedTypes.length >= 1e4) {
56386
- error(currentNode, isPartOfTypeNode(currentNode) ? Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent : Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent);
56358
+ error(
56359
+ currentNode,
56360
+ isPartOfTypeNode(currentNode) ? Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent : Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent
56361
+ );
56387
56362
  return errorType;
56388
56363
  }
56389
56364
  forEach(elements, (t, n) => {
@@ -56402,10 +56377,7 @@ function createTypeChecker(host) {
56402
56377
  expandedFlags[i] = 1 /* Required */;
56403
56378
  }
56404
56379
  if (firstRestIndex >= 0 && firstRestIndex < lastOptionalOrRestIndex) {
56405
- expandedTypes[firstRestIndex] = getUnionType(sameMap(
56406
- expandedTypes.slice(firstRestIndex, lastOptionalOrRestIndex + 1),
56407
- (t, i) => expandedFlags[firstRestIndex + i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t
56408
- ));
56380
+ expandedTypes[firstRestIndex] = getUnionType(sameMap(expandedTypes.slice(firstRestIndex, lastOptionalOrRestIndex + 1), (t, i) => expandedFlags[firstRestIndex + i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t));
56409
56381
  expandedTypes.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
56410
56382
  expandedFlags.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
56411
56383
  expandedDeclarations.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
@@ -56443,10 +56415,7 @@ function createTypeChecker(host) {
56443
56415
  );
56444
56416
  }
56445
56417
  function getKnownKeysOfTupleType(type) {
56446
- return getUnionType(append(
56447
- arrayOf(type.target.fixedLength, (i) => getStringLiteralType("" + i)),
56448
- getIndexType(type.target.readonly ? globalReadonlyArrayType : globalArrayType)
56449
- ));
56418
+ return getUnionType(append(arrayOf(type.target.fixedLength, (i) => getStringLiteralType("" + i)), getIndexType(type.target.readonly ? globalReadonlyArrayType : globalArrayType)));
56450
56419
  }
56451
56420
  function getStartElementCount(type, flags) {
56452
56421
  const index = findIndex(type.elementFlags, (f) => !(f & flags));
@@ -56582,10 +56551,7 @@ function createTypeChecker(host) {
56582
56551
  }
56583
56552
  }
56584
56553
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
56585
- const templates = filter(
56586
- types,
56587
- (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types))
56588
- );
56554
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types)));
56589
56555
  if (templates.length) {
56590
56556
  let i = types.length;
56591
56557
  while (i > 0) {
@@ -56755,12 +56721,7 @@ function createTypeChecker(host) {
56755
56721
  const links = getNodeLinks(node);
56756
56722
  if (!links.resolvedType) {
56757
56723
  const aliasSymbol = getAliasSymbolForTypeNode(node);
56758
- links.resolvedType = getUnionType(
56759
- map(node.types, getTypeFromTypeNode),
56760
- 1 /* Literal */,
56761
- aliasSymbol,
56762
- getTypeArgumentsForAliasSymbol(aliasSymbol)
56763
- );
56724
+ links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNode), 1 /* Literal */, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
56764
56725
  }
56765
56726
  return links.resolvedType;
56766
56727
  }
@@ -57113,11 +57074,7 @@ function createTypeChecker(host) {
57113
57074
  }
57114
57075
  function getIndexType(type, indexFlags = defaultIndexFlags) {
57115
57076
  type = getReducedType(type);
57116
- return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(
57117
- type,
57118
- (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */),
57119
- indexFlags === defaultIndexFlags
57120
- );
57077
+ return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === defaultIndexFlags);
57121
57078
  }
57122
57079
  function getExtractStringType(type) {
57123
57080
  if (keyofStringsOnly) {
@@ -57357,13 +57314,7 @@ function createTypeChecker(host) {
57357
57314
  error(indexNode, Diagnostics.A_tuple_type_cannot_be_indexed_with_a_negative_value);
57358
57315
  return undefinedType;
57359
57316
  }
57360
- error(
57361
- indexNode,
57362
- Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2,
57363
- typeToString(objectType),
57364
- getTypeReferenceArity(objectType),
57365
- unescapeLeadingUnderscores(propName)
57366
- );
57317
+ error(indexNode, Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, typeToString(objectType), getTypeReferenceArity(objectType), unescapeLeadingUnderscores(propName));
57367
57318
  } else {
57368
57319
  error(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType));
57369
57320
  }
@@ -58644,24 +58595,29 @@ function createTypeChecker(host) {
58644
58595
  if (typeVariable) {
58645
58596
  const mappedTypeVariable = instantiateType(typeVariable, mapper);
58646
58597
  if (typeVariable !== mappedTypeVariable) {
58647
- return mapTypeWithAlias(getReducedType(mappedTypeVariable), (t) => {
58648
- if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
58649
- if (!type.declaration.nameType) {
58650
- let constraint;
58651
- if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) {
58652
- return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
58653
- }
58654
- if (isGenericTupleType(t)) {
58655
- return instantiateMappedGenericTupleType(t, type, typeVariable, mapper);
58656
- }
58657
- if (isTupleType(t)) {
58658
- return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper));
58598
+ return mapTypeWithAlias(
58599
+ getReducedType(mappedTypeVariable),
58600
+ (t) => {
58601
+ if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
58602
+ if (!type.declaration.nameType) {
58603
+ let constraint;
58604
+ if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) {
58605
+ return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
58606
+ }
58607
+ if (isGenericTupleType(t)) {
58608
+ return instantiateMappedGenericTupleType(t, type, typeVariable, mapper);
58609
+ }
58610
+ if (isTupleType(t)) {
58611
+ return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper));
58612
+ }
58659
58613
  }
58614
+ return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper));
58660
58615
  }
58661
- return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper));
58662
- }
58663
- return t;
58664
- }, aliasSymbol, aliasTypeArguments);
58616
+ return t;
58617
+ },
58618
+ aliasSymbol,
58619
+ aliasTypeArguments
58620
+ );
58665
58621
  }
58666
58622
  }
58667
58623
  return instantiateType(getConstraintTypeFromMappedType(type), mapper) === wildcardType ? wildcardType : instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments);
@@ -59055,10 +59011,13 @@ function createTypeChecker(host) {
59055
59011
  const resultObj = errorOutputContainer || {};
59056
59012
  checkTypeAssignableTo(source, target, node, headMessage, containingMessageChain, resultObj);
59057
59013
  const diagnostic = resultObj.errors[resultObj.errors.length - 1];
59058
- addRelatedInfo(diagnostic, createDiagnosticForNode(
59059
- node,
59060
- signatures === constructSignatures ? Diagnostics.Did_you_mean_to_use_new_with_this_expression : Diagnostics.Did_you_mean_to_call_this_expression
59061
- ));
59014
+ addRelatedInfo(
59015
+ diagnostic,
59016
+ createDiagnosticForNode(
59017
+ node,
59018
+ signatures === constructSignatures ? Diagnostics.Did_you_mean_to_use_new_with_this_expression : Diagnostics.Did_you_mean_to_call_this_expression
59019
+ )
59020
+ );
59062
59021
  return true;
59063
59022
  }
59064
59023
  }
@@ -59115,10 +59074,13 @@ function createTypeChecker(host) {
59115
59074
  );
59116
59075
  if (resultObj.errors) {
59117
59076
  if (target.symbol && length(target.symbol.declarations)) {
59118
- addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], createDiagnosticForNode(
59119
- target.symbol.declarations[0],
59120
- Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature
59121
- ));
59077
+ addRelatedInfo(
59078
+ resultObj.errors[resultObj.errors.length - 1],
59079
+ createDiagnosticForNode(
59080
+ target.symbol.declarations[0],
59081
+ Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature
59082
+ )
59083
+ );
59122
59084
  }
59123
59085
  if ((getFunctionFlags(node) & 2 /* Async */) === 0 && !getTypeOfPropertyOfType(sourceReturn, "then") && checkTypeRelatedTo(
59124
59086
  createPromiseType(sourceReturn),
@@ -59127,10 +59089,13 @@ function createTypeChecker(host) {
59127
59089
  /*errorNode*/
59128
59090
  void 0
59129
59091
  )) {
59130
- addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], createDiagnosticForNode(
59131
- node,
59132
- Diagnostics.Did_you_mean_to_mark_this_function_as_async
59133
- ));
59092
+ addRelatedInfo(
59093
+ resultObj.errors[resultObj.errors.length - 1],
59094
+ createDiagnosticForNode(
59095
+ node,
59096
+ Diagnostics.Did_you_mean_to_mark_this_function_as_async
59097
+ )
59098
+ );
59134
59099
  }
59135
59100
  return true;
59136
59101
  }
@@ -59225,12 +59190,15 @@ function createTypeChecker(host) {
59225
59190
  if (!issuedElaboration && (targetProp && length(targetProp.declarations) || target.symbol && length(target.symbol.declarations))) {
59226
59191
  const targetNode = targetProp && length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0];
59227
59192
  if (!getSourceFileOfNode(targetNode).hasNoDefaultLib) {
59228
- addRelatedInfo(reportedDiag, createDiagnosticForNode(
59229
- targetNode,
59230
- Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,
59231
- propertyName && !(nameType.flags & 8192 /* UniqueESSymbol */) ? unescapeLeadingUnderscores(propertyName) : typeToString(nameType),
59232
- typeToString(target)
59233
- ));
59193
+ addRelatedInfo(
59194
+ reportedDiag,
59195
+ createDiagnosticForNode(
59196
+ targetNode,
59197
+ Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,
59198
+ propertyName && !(nameType.flags & 8192 /* UniqueESSymbol */) ? unescapeLeadingUnderscores(propertyName) : typeToString(nameType),
59199
+ typeToString(target)
59200
+ )
59201
+ );
59234
59202
  }
59235
59203
  }
59236
59204
  }
@@ -59612,11 +59580,7 @@ function createTypeChecker(host) {
59612
59580
  }
59613
59581
  if (!related) {
59614
59582
  if (reportErrors2) {
59615
- errorReporter(
59616
- Diagnostics.Types_of_parameters_0_and_1_are_incompatible,
59617
- unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)),
59618
- unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))
59619
- );
59583
+ errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), unescapeLeadingUnderscores(getParameterNameAtPosition(target, i)));
59620
59584
  }
59621
59585
  return 0 /* False */;
59622
59586
  }
@@ -59737,16 +59701,12 @@ function createTypeChecker(host) {
59737
59701
  const targetProperty = getPropertyOfType(targetEnumType, property.escapedName);
59738
59702
  if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) {
59739
59703
  if (errorReporter) {
59740
- errorReporter(
59741
- Diagnostics.Property_0_is_missing_in_type_1,
59742
- symbolName(property),
59743
- typeToString(
59744
- getDeclaredTypeOfSymbol(targetSymbol),
59745
- /*enclosingDeclaration*/
59746
- void 0,
59747
- 64 /* UseFullyQualifiedType */
59748
- )
59749
- );
59704
+ errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property), typeToString(
59705
+ getDeclaredTypeOfSymbol(targetSymbol),
59706
+ /*enclosingDeclaration*/
59707
+ void 0,
59708
+ 64 /* UseFullyQualifiedType */
59709
+ ));
59750
59710
  enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
59751
59711
  } else {
59752
59712
  enumRelation.set(id, 2 /* Failed */);
@@ -60419,18 +60379,9 @@ function createTypeChecker(host) {
60419
60379
  }
60420
60380
  }
60421
60381
  if (suggestion !== void 0) {
60422
- reportParentSkippedError(
60423
- Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
60424
- symbolToString(prop),
60425
- typeToString(errorTarget),
60426
- suggestion
60427
- );
60382
+ reportParentSkippedError(Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString(prop), typeToString(errorTarget), suggestion);
60428
60383
  } else {
60429
- reportParentSkippedError(
60430
- Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
60431
- symbolToString(prop),
60432
- typeToString(errorTarget)
60433
- );
60384
+ reportParentSkippedError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(errorTarget));
60434
60385
  }
60435
60386
  }
60436
60387
  }
@@ -61632,12 +61583,7 @@ function createTypeChecker(host) {
61632
61583
  if (sourcePropFlags & 8 /* Private */ && targetPropFlags & 8 /* Private */) {
61633
61584
  reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp));
61634
61585
  } else {
61635
- reportError(
61636
- Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2,
61637
- symbolToString(targetProp),
61638
- typeToString(sourcePropFlags & 8 /* Private */ ? source2 : target2),
61639
- typeToString(sourcePropFlags & 8 /* Private */ ? target2 : source2)
61640
- );
61586
+ reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags & 8 /* Private */ ? source2 : target2), typeToString(sourcePropFlags & 8 /* Private */ ? target2 : source2));
61641
61587
  }
61642
61588
  }
61643
61589
  return 0 /* False */;
@@ -61645,23 +61591,13 @@ function createTypeChecker(host) {
61645
61591
  } else if (targetPropFlags & 16 /* Protected */) {
61646
61592
  if (!isValidOverrideOf(sourceProp, targetProp)) {
61647
61593
  if (reportErrors2) {
61648
- reportError(
61649
- Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2,
61650
- symbolToString(targetProp),
61651
- typeToString(getDeclaringClass(sourceProp) || source2),
61652
- typeToString(getDeclaringClass(targetProp) || target2)
61653
- );
61594
+ reportError(Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source2), typeToString(getDeclaringClass(targetProp) || target2));
61654
61595
  }
61655
61596
  return 0 /* False */;
61656
61597
  }
61657
61598
  } else if (sourcePropFlags & 16 /* Protected */) {
61658
61599
  if (reportErrors2) {
61659
- reportError(
61660
- Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2,
61661
- symbolToString(targetProp),
61662
- typeToString(source2),
61663
- typeToString(target2)
61664
- );
61600
+ reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source2), typeToString(target2));
61665
61601
  }
61666
61602
  return 0 /* False */;
61667
61603
  }
@@ -61677,12 +61613,7 @@ function createTypeChecker(host) {
61677
61613
  }
61678
61614
  if (!skipOptional && sourceProp.flags & 16777216 /* Optional */ && targetProp.flags & 106500 /* ClassMember */ && !(targetProp.flags & 16777216 /* Optional */)) {
61679
61615
  if (reportErrors2) {
61680
- reportError(
61681
- Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2,
61682
- symbolToString(targetProp),
61683
- typeToString(source2),
61684
- typeToString(target2)
61685
- );
61616
+ reportError(Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source2), typeToString(target2));
61686
61617
  }
61687
61618
  return 0 /* False */;
61688
61619
  }
@@ -61928,8 +61859,14 @@ function createTypeChecker(host) {
61928
61859
  }
61929
61860
  const sourceIsJSConstructor = source2.symbol && isJSConstructor(source2.symbol.valueDeclaration);
61930
61861
  const targetIsJSConstructor = target2.symbol && isJSConstructor(target2.symbol.valueDeclaration);
61931
- const sourceSignatures = getSignaturesOfType(source2, sourceIsJSConstructor && kind === 1 /* Construct */ ? 0 /* Call */ : kind);
61932
- const targetSignatures = getSignaturesOfType(target2, targetIsJSConstructor && kind === 1 /* Construct */ ? 0 /* Call */ : kind);
61862
+ const sourceSignatures = getSignaturesOfType(
61863
+ source2,
61864
+ sourceIsJSConstructor && kind === 1 /* Construct */ ? 0 /* Call */ : kind
61865
+ );
61866
+ const targetSignatures = getSignaturesOfType(
61867
+ target2,
61868
+ targetIsJSConstructor && kind === 1 /* Construct */ ? 0 /* Call */ : kind
61869
+ );
61933
61870
  if (kind === 1 /* Construct */ && sourceSignatures.length && targetSignatures.length) {
61934
61871
  const sourceIsAbstract = !!(sourceSignatures[0].flags & 4 /* Abstract */);
61935
61872
  const targetIsAbstract = !!(targetSignatures[0].flags & 4 /* Abstract */);
@@ -62003,18 +61940,14 @@ function createTypeChecker(host) {
62003
61940
  shouldElaborateErrors = false;
62004
61941
  }
62005
61942
  if (shouldElaborateErrors) {
62006
- reportError(
62007
- Diagnostics.Type_0_provides_no_match_for_the_signature_1,
62008
- typeToString(source2),
62009
- signatureToString(
62010
- t,
62011
- /*enclosingDeclaration*/
62012
- void 0,
62013
- /*flags*/
62014
- void 0,
62015
- kind
62016
- )
62017
- );
61943
+ reportError(Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source2), signatureToString(
61944
+ t,
61945
+ /*enclosingDeclaration*/
61946
+ void 0,
61947
+ /*flags*/
61948
+ void 0,
61949
+ kind
61950
+ ));
62018
61951
  }
62019
61952
  return 0 /* False */;
62020
61953
  }
@@ -62047,16 +61980,7 @@ function createTypeChecker(host) {
62047
61980
  }
62048
61981
  function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) {
62049
61982
  const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */;
62050
- return compareSignaturesRelated(
62051
- erase ? getErasedSignature(source2) : source2,
62052
- erase ? getErasedSignature(target2) : target2,
62053
- checkMode,
62054
- reportErrors2,
62055
- reportError,
62056
- incompatibleReporter,
62057
- isRelatedToWorker2,
62058
- reportUnreliableMapper
62059
- );
61983
+ return compareSignaturesRelated(erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, checkMode, reportErrors2, reportError, incompatibleReporter, isRelatedToWorker2, reportUnreliableMapper);
62060
61984
  function isRelatedToWorker2(source3, target3, reportErrors3) {
62061
61985
  return isRelatedTo(
62062
61986
  source3,
@@ -62965,13 +62889,7 @@ function createTypeChecker(host) {
62965
62889
  }
62966
62890
  }
62967
62891
  }
62968
- const result = createAnonymousType(
62969
- type.symbol,
62970
- members,
62971
- emptyArray,
62972
- emptyArray,
62973
- sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly))
62974
- );
62892
+ const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
62975
62893
  result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
62976
62894
  return result;
62977
62895
  }
@@ -63184,19 +63102,25 @@ function createTypeChecker(host) {
63184
63102
  return context;
63185
63103
  }
63186
63104
  function makeFixingMapperForContext(context) {
63187
- return makeDeferredTypeMapper(map(context.inferences, (i) => i.typeParameter), map(context.inferences, (inference, i) => () => {
63188
- if (!inference.isFixed) {
63189
- inferFromIntraExpressionSites(context);
63190
- clearCachedInferences(context.inferences);
63191
- inference.isFixed = true;
63192
- }
63193
- return getInferredType(context, i);
63194
- }));
63105
+ return makeDeferredTypeMapper(
63106
+ map(context.inferences, (i) => i.typeParameter),
63107
+ map(context.inferences, (inference, i) => () => {
63108
+ if (!inference.isFixed) {
63109
+ inferFromIntraExpressionSites(context);
63110
+ clearCachedInferences(context.inferences);
63111
+ inference.isFixed = true;
63112
+ }
63113
+ return getInferredType(context, i);
63114
+ })
63115
+ );
63195
63116
  }
63196
63117
  function makeNonFixingMapperForContext(context) {
63197
- return makeDeferredTypeMapper(map(context.inferences, (i) => i.typeParameter), map(context.inferences, (_, i) => () => {
63198
- return getInferredType(context, i);
63199
- }));
63118
+ return makeDeferredTypeMapper(
63119
+ map(context.inferences, (i) => i.typeParameter),
63120
+ map(context.inferences, (_, i) => () => {
63121
+ return getInferredType(context, i);
63122
+ })
63123
+ );
63200
63124
  }
63201
63125
  function clearCachedInferences(inferences) {
63202
63126
  for (const inference of inferences) {
@@ -63944,11 +63868,7 @@ function createTypeChecker(host) {
63944
63868
  )) {
63945
63869
  allTypeFlags &= ~2112 /* BigIntLike */;
63946
63870
  }
63947
- const matchingType = reduceLeft(
63948
- constraintTypes,
63949
- (left, right) => !(right.flags & allTypeFlags) ? left : left.flags & 4 /* String */ ? left : right.flags & 4 /* String */ ? source2 : left.flags & 134217728 /* TemplateLiteral */ ? left : right.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source2, right) ? source2 : left.flags & 268435456 /* StringMapping */ ? left : right.flags & 268435456 /* StringMapping */ && str === applyStringMapping(right.symbol, str) ? source2 : left.flags & 128 /* StringLiteral */ ? left : right.flags & 128 /* StringLiteral */ && right.value === str ? right : left.flags & 8 /* Number */ ? left : right.flags & 8 /* Number */ ? getNumberLiteralType(+str) : left.flags & 32 /* Enum */ ? left : right.flags & 32 /* Enum */ ? getNumberLiteralType(+str) : left.flags & 256 /* NumberLiteral */ ? left : right.flags & 256 /* NumberLiteral */ && right.value === +str ? right : left.flags & 64 /* BigInt */ ? left : right.flags & 64 /* BigInt */ ? parseBigIntLiteralType(str) : left.flags & 2048 /* BigIntLiteral */ ? left : right.flags & 2048 /* BigIntLiteral */ && pseudoBigIntToString(right.value) === str ? right : left.flags & 16 /* Boolean */ ? left : right.flags & 16 /* Boolean */ ? str === "true" ? trueType : str === "false" ? falseType : booleanType : left.flags & 512 /* BooleanLiteral */ ? left : right.flags & 512 /* BooleanLiteral */ && right.intrinsicName === str ? right : left.flags & 32768 /* Undefined */ ? left : right.flags & 32768 /* Undefined */ && right.intrinsicName === str ? right : left.flags & 65536 /* Null */ ? left : right.flags & 65536 /* Null */ && right.intrinsicName === str ? right : left,
63950
- neverType
63951
- );
63871
+ const matchingType = reduceLeft(constraintTypes, (left, right) => !(right.flags & allTypeFlags) ? left : left.flags & 4 /* String */ ? left : right.flags & 4 /* String */ ? source2 : left.flags & 134217728 /* TemplateLiteral */ ? left : right.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source2, right) ? source2 : left.flags & 268435456 /* StringMapping */ ? left : right.flags & 268435456 /* StringMapping */ && str === applyStringMapping(right.symbol, str) ? source2 : left.flags & 128 /* StringLiteral */ ? left : right.flags & 128 /* StringLiteral */ && right.value === str ? right : left.flags & 8 /* Number */ ? left : right.flags & 8 /* Number */ ? getNumberLiteralType(+str) : left.flags & 32 /* Enum */ ? left : right.flags & 32 /* Enum */ ? getNumberLiteralType(+str) : left.flags & 256 /* NumberLiteral */ ? left : right.flags & 256 /* NumberLiteral */ && right.value === +str ? right : left.flags & 64 /* BigInt */ ? left : right.flags & 64 /* BigInt */ ? parseBigIntLiteralType(str) : left.flags & 2048 /* BigIntLiteral */ ? left : right.flags & 2048 /* BigIntLiteral */ && pseudoBigIntToString(right.value) === str ? right : left.flags & 16 /* Boolean */ ? left : right.flags & 16 /* Boolean */ ? str === "true" ? trueType : str === "false" ? falseType : booleanType : left.flags & 512 /* BooleanLiteral */ ? left : right.flags & 512 /* BooleanLiteral */ && right.intrinsicName === str ? right : left.flags & 32768 /* Undefined */ ? left : right.flags & 32768 /* Undefined */ && right.intrinsicName === str ? right : left.flags & 65536 /* Null */ ? left : right.flags & 65536 /* Null */ && right.intrinsicName === str ? right : left, neverType);
63952
63872
  if (!(matchingType.flags & 131072 /* Never */)) {
63953
63873
  inferFromTypes(matchingType, target2);
63954
63874
  continue;
@@ -63994,10 +63914,7 @@ function createTypeChecker(host) {
63994
63914
  return;
63995
63915
  }
63996
63916
  const startLength = isTupleType(source) ? Math.min(source.target.fixedLength, target.target.fixedLength) : 0;
63997
- const endLength = Math.min(
63998
- isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0,
63999
- target.target.hasRestElement ? getEndElementCount(target.target, 3 /* Fixed */) : 0
64000
- );
63917
+ const endLength = Math.min(isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, target.target.hasRestElement ? getEndElementCount(target.target, 3 /* Fixed */) : 0);
64001
63918
  for (let i = 0; i < startLength; i++) {
64002
63919
  inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
64003
63920
  }
@@ -64919,7 +64836,9 @@ function createTypeChecker(host) {
64919
64836
  return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));
64920
64837
  }
64921
64838
  function createFinalArrayType(elementType) {
64922
- return elementType.flags & 131072 /* Never */ ? autoArrayType : createArrayType(elementType.flags & 1048576 /* Union */ ? getUnionType(elementType.types, 2 /* Subtype */) : elementType);
64839
+ return elementType.flags & 131072 /* Never */ ? autoArrayType : createArrayType(
64840
+ elementType.flags & 1048576 /* Union */ ? getUnionType(elementType.types, 2 /* Subtype */) : elementType
64841
+ );
64923
64842
  }
64924
64843
  function getFinalArrayType(evolvingArrayType) {
64925
64844
  return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
@@ -65320,7 +65239,10 @@ function createTypeChecker(host) {
65320
65239
  }
65321
65240
  function getInitialOrAssignedType(flow) {
65322
65241
  const node = flow.node;
65323
- return getNarrowableTypeForReference(node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference);
65242
+ return getNarrowableTypeForReference(
65243
+ node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */ ? getInitialType(node) : getAssignedType(node),
65244
+ reference
65245
+ );
65324
65246
  }
65325
65247
  function getTypeAtFlowAssignment(flow) {
65326
65248
  const node = flow.node;
@@ -65459,21 +65381,9 @@ function createTypeChecker(host) {
65459
65381
  } else {
65460
65382
  if (strictNullChecks) {
65461
65383
  if (optionalChainContainsReference(expr, reference)) {
65462
- type = narrowTypeBySwitchOptionalChainContainment(
65463
- type,
65464
- flow.switchStatement,
65465
- flow.clauseStart,
65466
- flow.clauseEnd,
65467
- (t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */))
65468
- );
65384
+ type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, (t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)));
65469
65385
  } else if (expr.kind === 221 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
65470
- type = narrowTypeBySwitchOptionalChainContainment(
65471
- type,
65472
- flow.switchStatement,
65473
- flow.clauseStart,
65474
- flow.clauseEnd,
65475
- (t) => !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined")
65476
- );
65386
+ type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, (t) => !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"));
65477
65387
  }
65478
65388
  }
65479
65389
  const access = getDiscriminantPropertyAccess(expr, type);
@@ -66096,7 +66006,10 @@ function createTypeChecker(host) {
66096
66006
  const narrowedType = mapType(candidate, (c) => {
66097
66007
  const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName);
66098
66008
  const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
66099
- const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType);
66009
+ const directlyRelated = mapType(
66010
+ matching || type,
66011
+ checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType
66012
+ );
66100
66013
  return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
66101
66014
  });
66102
66015
  return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]);
@@ -68133,7 +68046,10 @@ function createTypeChecker(host) {
68133
68046
  inConstContext
68134
68047
  ));
68135
68048
  }
68136
- return createArrayLiteralType(createArrayType(elementTypes.length ? getUnionType(sameMap(elementTypes, (t, i) => elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessTypeOrUndefined(t, numberType) || anyType : t), 2 /* Subtype */) : strictNullChecks ? implicitNeverType : undefinedWideningType, inConstContext));
68049
+ return createArrayLiteralType(createArrayType(
68050
+ elementTypes.length ? getUnionType(sameMap(elementTypes, (t, i) => elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessTypeOrUndefined(t, numberType) || anyType : t), 2 /* Subtype */) : strictNullChecks ? implicitNeverType : undefinedWideningType,
68051
+ inConstContext
68052
+ ));
68137
68053
  }
68138
68054
  function createArrayLiteralType(type) {
68139
68055
  if (!(getObjectFlags(type) & 4 /* Reference */)) {
@@ -68286,12 +68202,7 @@ function createTypeChecker(host) {
68286
68202
  if (impliedProp) {
68287
68203
  prop.flags |= impliedProp.flags & 16777216 /* Optional */;
68288
68204
  } else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, stringType)) {
68289
- error(
68290
- memberDecl.name,
68291
- Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
68292
- symbolToString(member),
68293
- typeToString(contextualType)
68294
- );
68205
+ error(memberDecl.name, Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType));
68295
68206
  }
68296
68207
  }
68297
68208
  prop.declarations = member.declarations;
@@ -68361,22 +68272,13 @@ function createTypeChecker(host) {
68361
68272
  }
68362
68273
  popContextualType();
68363
68274
  if (contextualTypeHasPattern) {
68364
- const rootPatternParent = findAncestor(
68365
- contextualType.pattern.parent,
68366
- (n) => n.kind === 260 /* VariableDeclaration */ || n.kind === 226 /* BinaryExpression */ || n.kind === 169 /* Parameter */
68367
- );
68368
- const spreadOrOutsideRootObject = findAncestor(
68369
- node,
68370
- (n) => n === rootPatternParent || n.kind === 305 /* SpreadAssignment */
68371
- );
68275
+ const rootPatternParent = findAncestor(contextualType.pattern.parent, (n) => n.kind === 260 /* VariableDeclaration */ || n.kind === 226 /* BinaryExpression */ || n.kind === 169 /* Parameter */);
68276
+ const spreadOrOutsideRootObject = findAncestor(node, (n) => n === rootPatternParent || n.kind === 305 /* SpreadAssignment */);
68372
68277
  if (spreadOrOutsideRootObject.kind !== 305 /* SpreadAssignment */) {
68373
68278
  for (const prop of getPropertiesOfType(contextualType)) {
68374
68279
  if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
68375
68280
  if (!(prop.flags & 16777216 /* Optional */)) {
68376
- error(
68377
- prop.valueDeclaration || ((_a = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a.links.bindingElement),
68378
- Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value
68379
- );
68281
+ error(prop.valueDeclaration || ((_a = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a.links.bindingElement), Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
68380
68282
  }
68381
68283
  propertiesTable.set(prop.escapedName, prop);
68382
68284
  propertiesArray.push(prop);
@@ -68448,7 +68350,10 @@ function createTypeChecker(host) {
68448
68350
  checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment);
68449
68351
  const nodeSourceFile = getSourceFileOfNode(node);
68450
68352
  if (getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) {
68451
- error(node, compilerOptions.jsxFactory ? Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option : Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments);
68353
+ error(
68354
+ node,
68355
+ compilerOptions.jsxFactory ? Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option : Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments
68356
+ );
68452
68357
  }
68453
68358
  checkJsxChildren(node);
68454
68359
  return getJsxElementTypeAt(node) || anyType;
@@ -69029,12 +68934,7 @@ function createTypeChecker(host) {
69029
68934
  }
69030
68935
  if (flags & 256 /* Abstract */) {
69031
68936
  if (errorNode) {
69032
- error(
69033
- errorNode,
69034
- Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression,
69035
- symbolToString(prop),
69036
- typeToString(getDeclaringClass(prop))
69037
- );
68937
+ error(errorNode, Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop)));
69038
68938
  }
69039
68939
  return false;
69040
68940
  }
@@ -69043,12 +68943,7 @@ function createTypeChecker(host) {
69043
68943
  const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
69044
68944
  if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(location)) {
69045
68945
  if (errorNode) {
69046
- error(
69047
- errorNode,
69048
- Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor,
69049
- symbolToString(prop),
69050
- getTextOfIdentifierOrLiteral(declaringClassDeclaration.name)
69051
- );
68946
+ error(errorNode, Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString(prop), getTextOfIdentifierOrLiteral(declaringClassDeclaration.name));
69052
68947
  }
69053
68948
  return false;
69054
68949
  }
@@ -69060,12 +68955,7 @@ function createTypeChecker(host) {
69060
68955
  const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
69061
68956
  if (!isNodeWithinClass(location, declaringClassDeclaration)) {
69062
68957
  if (errorNode) {
69063
- error(
69064
- errorNode,
69065
- Diagnostics.Property_0_is_private_and_only_accessible_within_class_1,
69066
- symbolToString(prop),
69067
- typeToString(getDeclaringClass(prop))
69068
- );
68958
+ error(errorNode, Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop)));
69069
68959
  }
69070
68960
  return false;
69071
68961
  }
@@ -69083,12 +68973,7 @@ function createTypeChecker(host) {
69083
68973
  enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
69084
68974
  if (flags & 32 /* Static */ || !enclosingClass) {
69085
68975
  if (errorNode) {
69086
- error(
69087
- errorNode,
69088
- Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses,
69089
- symbolToString(prop),
69090
- typeToString(getDeclaringClass(prop) || containingType)
69091
- );
68976
+ error(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType));
69092
68977
  }
69093
68978
  return false;
69094
68979
  }
@@ -69101,13 +68986,7 @@ function createTypeChecker(host) {
69101
68986
  }
69102
68987
  if (!containingType || !hasBaseType(containingType, enclosingClass)) {
69103
68988
  if (errorNode) {
69104
- error(
69105
- errorNode,
69106
- Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2,
69107
- symbolToString(prop),
69108
- typeToString(enclosingClass),
69109
- typeToString(containingType)
69110
- );
68989
+ error(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2, symbolToString(prop), typeToString(enclosingClass), typeToString(containingType));
69111
68990
  }
69112
68991
  return false;
69113
68992
  }
@@ -69519,10 +69398,7 @@ function createTypeChecker(host) {
69519
69398
  diagnosticMessage = error(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
69520
69399
  }
69521
69400
  if (diagnosticMessage) {
69522
- addRelatedInfo(
69523
- diagnosticMessage,
69524
- createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here, declarationName)
69525
- );
69401
+ addRelatedInfo(diagnosticMessage, createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here, declarationName));
69526
69402
  }
69527
69403
  }
69528
69404
  function isInPropertyInitializerOrClassStaticBlock(node) {
@@ -70462,12 +70338,7 @@ function createTypeChecker(host) {
70462
70338
  forEach(getElementTypes(spreadType), (t, i2) => {
70463
70339
  var _a;
70464
70340
  const flags = spreadType.target.elementFlags[i2];
70465
- const syntheticArg = createSyntheticExpression(
70466
- arg,
70467
- flags & 4 /* Rest */ ? createArrayType(t) : t,
70468
- !!(flags & 12 /* Variable */),
70469
- (_a = spreadType.target.labeledElementDeclarations) == null ? void 0 : _a[i2]
70470
- );
70341
+ const syntheticArg = createSyntheticExpression(arg, flags & 4 /* Rest */ ? createArrayType(t) : t, !!(flags & 12 /* Variable */), (_a = spreadType.target.labeledElementDeclarations) == null ? void 0 : _a[i2]);
70471
70342
  effectiveArgs.push(syntheticArg);
70472
70343
  });
70473
70344
  } else {
@@ -71385,10 +71256,7 @@ function createTypeChecker(host) {
71385
71256
  const sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind);
71386
71257
  if (!sigs || !sigs.length)
71387
71258
  return;
71388
- addRelatedInfo(
71389
- diagnostic,
71390
- createDiagnosticForNode(importNode, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead)
71391
- );
71259
+ addRelatedInfo(diagnostic, createDiagnosticForNode(importNode, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead));
71392
71260
  }
71393
71261
  }
71394
71262
  function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) {
@@ -72015,12 +71883,7 @@ function createTypeChecker(host) {
72015
71883
  addLazyDiagnostic(() => {
72016
71884
  const widenedType = getWidenedType(exprType);
72017
71885
  if (!isTypeComparableTo(targetType, widenedType)) {
72018
- checkTypeComparableTo(
72019
- exprType,
72020
- targetType,
72021
- errNode,
72022
- Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first
72023
- );
71886
+ checkTypeComparableTo(exprType, targetType, errNode, Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first);
72024
71887
  }
72025
71888
  });
72026
71889
  }
@@ -72394,7 +72257,14 @@ function createTypeChecker(host) {
72394
72257
  if (declaration.type) {
72395
72258
  const typeNode = getEffectiveTypeAnnotationNode(declaration);
72396
72259
  if (typeNode) {
72397
- inferTypes(inferenceContext.inferences, getTypeFromTypeNode(typeNode), getTypeAtPosition(context, i));
72260
+ const source = addOptionality(
72261
+ getTypeFromTypeNode(typeNode),
72262
+ /*isProperty*/
72263
+ false,
72264
+ isOptionalDeclaration(declaration)
72265
+ );
72266
+ const target = getTypeAtPosition(context, i);
72267
+ inferTypes(inferenceContext.inferences, source, target);
72398
72268
  }
72399
72269
  }
72400
72270
  }
@@ -72737,13 +72607,19 @@ function createTypeChecker(host) {
72737
72607
  function createPromiseReturnType(func, promisedType) {
72738
72608
  const promiseType = createPromiseType(promisedType);
72739
72609
  if (promiseType === unknownType) {
72740
- error(func, isImportCall(func) ? Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option);
72610
+ error(
72611
+ func,
72612
+ isImportCall(func) ? Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option
72613
+ );
72741
72614
  return errorType;
72742
72615
  } else if (!getGlobalPromiseConstructorSymbol(
72743
72616
  /*reportErrors*/
72744
72617
  true
72745
72618
  )) {
72746
- error(func, isImportCall(func) ? Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
72619
+ error(
72620
+ func,
72621
+ isImportCall(func) ? Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option
72622
+ );
72747
72623
  }
72748
72624
  return promiseType;
72749
72625
  }
@@ -72926,7 +72802,11 @@ function createTypeChecker(host) {
72926
72802
  function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync) {
72927
72803
  const errorNode = node.expression || node;
72928
72804
  const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */, expressionType, sentType, errorNode) : expressionType;
72929
- return !isAsync ? yieldedType : getAwaitedType(yieldedType, errorNode, node.asteriskToken ? Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
72805
+ return !isAsync ? yieldedType : getAwaitedType(
72806
+ yieldedType,
72807
+ errorNode,
72808
+ node.asteriskToken ? Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
72809
+ );
72930
72810
  }
72931
72811
  function getNotEqualFactsFromTypeofSwitch(start, end, witnesses) {
72932
72812
  let facts = 0 /* None */;
@@ -73424,11 +73304,7 @@ function createTypeChecker(host) {
73424
73304
  return facts === 4194304 /* Truthy */ ? falseType : facts === 8388608 /* Falsy */ ? trueType : booleanType;
73425
73305
  case 46 /* PlusPlusToken */:
73426
73306
  case 47 /* MinusMinusToken */:
73427
- const ok = checkArithmeticOperandType(
73428
- node.operand,
73429
- checkNonNullType(operandType, node.operand),
73430
- Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type
73431
- );
73307
+ const ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type);
73432
73308
  if (ok) {
73433
73309
  checkReferenceExpression(
73434
73310
  node.operand,
@@ -74021,7 +73897,9 @@ function createTypeChecker(host) {
74021
73897
  }
74022
73898
  if (!resultType) {
74023
73899
  const closeEnoughKind = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 3 /* AnyOrUnknown */;
74024
- reportOperatorError((left2, right2) => isTypeAssignableToKind(left2, closeEnoughKind) && isTypeAssignableToKind(right2, closeEnoughKind));
73900
+ reportOperatorError(
73901
+ (left2, right2) => isTypeAssignableToKind(left2, closeEnoughKind) && isTypeAssignableToKind(right2, closeEnoughKind)
73902
+ );
74025
73903
  return anyType;
74026
73904
  }
74027
73905
  if (operator === 65 /* PlusEqualsToken */) {
@@ -74185,11 +74063,7 @@ function createTypeChecker(host) {
74185
74063
  true
74186
74064
  );
74187
74065
  }
74188
- if (checkReferenceExpression(
74189
- left,
74190
- Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,
74191
- Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access
74192
- )) {
74066
+ if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)) {
74193
74067
  let headMessage;
74194
74068
  if (exactOptionalPropertyTypes && isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768 /* Undefined */)) {
74195
74069
  const target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText);
@@ -74271,21 +74145,13 @@ function createTypeChecker(host) {
74271
74145
  const isLeftNaN = isGlobalNaN(skipParentheses(left2));
74272
74146
  const isRightNaN = isGlobalNaN(skipParentheses(right2));
74273
74147
  if (isLeftNaN || isRightNaN) {
74274
- const err = error(
74275
- errorNode2,
74276
- Diagnostics.This_condition_will_always_return_0,
74277
- tokenToString(operator2 === 37 /* EqualsEqualsEqualsToken */ || operator2 === 35 /* EqualsEqualsToken */ ? 97 /* FalseKeyword */ : 112 /* TrueKeyword */)
74278
- );
74148
+ const err = error(errorNode2, Diagnostics.This_condition_will_always_return_0, tokenToString(operator2 === 37 /* EqualsEqualsEqualsToken */ || operator2 === 35 /* EqualsEqualsToken */ ? 97 /* FalseKeyword */ : 112 /* TrueKeyword */));
74279
74149
  if (isLeftNaN && isRightNaN)
74280
74150
  return;
74281
74151
  const operatorString = operator2 === 38 /* ExclamationEqualsEqualsToken */ || operator2 === 36 /* ExclamationEqualsToken */ ? tokenToString(54 /* ExclamationToken */) : "";
74282
74152
  const location = isLeftNaN ? right2 : left2;
74283
74153
  const expression = skipParentheses(location);
74284
- addRelatedInfo(err, createDiagnosticForNode(
74285
- location,
74286
- Diagnostics.Did_you_mean_0,
74287
- `${operatorString}Number.isNaN(${isEntityNameExpression(expression) ? entityNameToString(expression) : "..."})`
74288
- ));
74154
+ addRelatedInfo(err, createDiagnosticForNode(location, Diagnostics.Did_you_mean_0, `${operatorString}Number.isNaN(${isEntityNameExpression(expression) ? entityNameToString(expression) : "..."})`));
74289
74155
  }
74290
74156
  }
74291
74157
  function isGlobalNaN(expr) {
@@ -75069,11 +74935,7 @@ function createTypeChecker(host) {
75069
74935
  }
75070
74936
  const name = element.name;
75071
74937
  if (name.kind === 80 /* Identifier */ && name.escapedText === predicateVariableName) {
75072
- error(
75073
- predicateVariableNode,
75074
- Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern,
75075
- predicateVariableName
75076
- );
74938
+ error(predicateVariableNode, Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName);
75077
74939
  return true;
75078
74940
  } else if (name.kind === 207 /* ArrayBindingPattern */ || name.kind === 206 /* ObjectBindingPattern */) {
75079
74941
  if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(
@@ -75473,12 +75335,7 @@ function createTypeChecker(host) {
75473
75335
  return getEffectiveTypeArguments(node, typeParameters)[index];
75474
75336
  }
75475
75337
  function getEffectiveTypeArguments(node, typeParameters) {
75476
- return fillMissingTypeArguments(
75477
- map(node.typeArguments, getTypeFromTypeNode),
75478
- typeParameters,
75479
- getMinTypeArgumentCount(typeParameters),
75480
- isInJSFile(node)
75481
- );
75338
+ return fillMissingTypeArguments(map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(node));
75482
75339
  }
75483
75340
  function checkTypeArgumentConstraints(node, typeParameters) {
75484
75341
  let typeArguments;
@@ -76293,12 +76150,7 @@ function createTypeChecker(host) {
76293
76150
  const rootName = promiseConstructorName && getFirstIdentifier(promiseConstructorName);
76294
76151
  const collidingSymbol = getSymbol(node.locals, rootName.escapedText, 111551 /* Value */);
76295
76152
  if (collidingSymbol) {
76296
- error(
76297
- collidingSymbol.valueDeclaration,
76298
- Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,
76299
- idText(rootName),
76300
- entityNameToString(promiseConstructorName)
76301
- );
76153
+ error(collidingSymbol.valueDeclaration, Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, idText(rootName), entityNameToString(promiseConstructorName));
76302
76154
  return;
76303
76155
  }
76304
76156
  }
@@ -76901,7 +76753,11 @@ function createTypeChecker(host) {
76901
76753
  const importDecl = importClause.parent;
76902
76754
  const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 274 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0);
76903
76755
  if (nDeclarations === unuseds.length) {
76904
- addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 ? createDiagnosticForNode(importDecl, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(first(unuseds).name)) : createDiagnosticForNode(importDecl, Diagnostics.All_imports_in_import_declaration_are_unused));
76756
+ addDiagnostic(
76757
+ importDecl,
76758
+ 0 /* Local */,
76759
+ unuseds.length === 1 ? createDiagnosticForNode(importDecl, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(first(unuseds).name)) : createDiagnosticForNode(importDecl, Diagnostics.All_imports_in_import_declaration_are_unused)
76760
+ );
76905
76761
  } else {
76906
76762
  for (const unused of unuseds)
76907
76763
  errorUnusedLocal(unused, idText(unused.name), addDiagnostic);
@@ -76913,7 +76769,11 @@ function createTypeChecker(host) {
76913
76769
  if (bindingElements.length === 1 && bindingPattern.parent.kind === 260 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 261 /* VariableDeclarationList */) {
76914
76770
  addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);
76915
76771
  } else {
76916
- addDiagnostic(bindingPattern, kind, bindingElements.length === 1 ? createDiagnosticForNode(bindingPattern, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(bindingElements).name)) : createDiagnosticForNode(bindingPattern, Diagnostics.All_destructured_elements_are_unused));
76772
+ addDiagnostic(
76773
+ bindingPattern,
76774
+ kind,
76775
+ bindingElements.length === 1 ? createDiagnosticForNode(bindingPattern, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(bindingElements).name)) : createDiagnosticForNode(bindingPattern, Diagnostics.All_destructured_elements_are_unused)
76776
+ );
76917
76777
  }
76918
76778
  } else {
76919
76779
  for (const e of bindingElements) {
@@ -76923,7 +76783,11 @@ function createTypeChecker(host) {
76923
76783
  });
76924
76784
  unusedVariables.forEach(([declarationList, declarations]) => {
76925
76785
  if (declarationList.declarations.length === declarations.length) {
76926
- addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 243 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused));
76786
+ addDiagnostic(
76787
+ declarationList,
76788
+ 0 /* Local */,
76789
+ declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 243 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused)
76790
+ );
76927
76791
  } else {
76928
76792
  for (const decl of declarations) {
76929
76793
  addDiagnostic(decl, 0 /* Local */, createDiagnosticForNode(decl, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name)));
@@ -77051,13 +76915,7 @@ function createTypeChecker(host) {
77051
76915
  }
77052
76916
  const parent = getDeclarationContainer(node);
77053
76917
  if (parent.kind === 312 /* SourceFile */ && isExternalOrCommonJsModule(parent)) {
77054
- errorSkippedOn(
77055
- "noEmit",
77056
- name,
77057
- Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module,
77058
- declarationNameToString(name),
77059
- declarationNameToString(name)
77060
- );
76918
+ errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, declarationNameToString(name), declarationNameToString(name));
77061
76919
  }
77062
76920
  }
77063
76921
  function checkCollisionWithGlobalPromiseInGeneratedCode(node, name) {
@@ -77069,13 +76927,7 @@ function createTypeChecker(host) {
77069
76927
  }
77070
76928
  const parent = getDeclarationContainer(node);
77071
76929
  if (parent.kind === 312 /* SourceFile */ && isExternalOrCommonJsModule(parent) && parent.flags & 4096 /* HasAsyncFunctions */) {
77072
- errorSkippedOn(
77073
- "noEmit",
77074
- name,
77075
- Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions,
77076
- declarationNameToString(name),
77077
- declarationNameToString(name)
77078
- );
76930
+ errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, declarationNameToString(name), declarationNameToString(name));
77079
76931
  }
77080
76932
  }
77081
76933
  function recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name) {
@@ -77116,13 +76968,7 @@ function createTypeChecker(host) {
77116
76968
  }
77117
76969
  if (hasCollision) {
77118
76970
  Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name), "The target of a Reflect collision check should be an identifier");
77119
- errorSkippedOn(
77120
- "noEmit",
77121
- node,
77122
- Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers,
77123
- declarationNameToString(node.name),
77124
- "Reflect"
77125
- );
76971
+ errorSkippedOn("noEmit", node, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers, declarationNameToString(node.name), "Reflect");
77126
76972
  }
77127
76973
  }
77128
76974
  function checkCollisionsForDeclarationName(node, name) {
@@ -77357,10 +77203,7 @@ function createTypeChecker(host) {
77357
77203
  typeToString(nextType)
77358
77204
  );
77359
77205
  if (firstDeclaration) {
77360
- addRelatedInfo(
77361
- err,
77362
- createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here, declName)
77363
- );
77206
+ addRelatedInfo(err, createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here, declName));
77364
77207
  }
77365
77208
  }
77366
77209
  function areDeclarationFlagsIdentical(left, right) {
@@ -77997,13 +77840,10 @@ function createTypeChecker(host) {
77997
77840
  !!getAwaitedTypeOfPromise(type) || !allowAsyncIterables && isForOfStatement(errorNode.parent) && errorNode.parent.expression === errorNode && getGlobalAsyncIterableType(
77998
77841
  /*reportErrors*/
77999
77842
  false
78000
- ) !== emptyGenericType && isTypeAssignableTo(
78001
- type,
78002
- getGlobalAsyncIterableType(
78003
- /*reportErrors*/
78004
- false
78005
- )
78006
- )
77843
+ ) !== emptyGenericType && isTypeAssignableTo(type, getGlobalAsyncIterableType(
77844
+ /*reportErrors*/
77845
+ false
77846
+ ))
78007
77847
  );
78008
77848
  return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type));
78009
77849
  }
@@ -78460,14 +78300,7 @@ function createTypeChecker(host) {
78460
78300
  const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfDeclaration(info.declaration)) === type.symbol ? info.declaration : void 0;
78461
78301
  const errorNode = localPropDeclaration || localIndexDeclaration || (interfaceDeclaration && !some(getBaseTypes(type), (base) => !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType)) ? interfaceDeclaration : void 0);
78462
78302
  if (errorNode && !isTypeAssignableTo(propType, info.type)) {
78463
- const diagnostic = createError(
78464
- errorNode,
78465
- Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3,
78466
- symbolToString(prop),
78467
- typeToString(propType),
78468
- typeToString(info.keyType),
78469
- typeToString(info.type)
78470
- );
78303
+ const diagnostic = createError(errorNode, Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, symbolToString(prop), typeToString(propType), typeToString(info.keyType), typeToString(info.type));
78471
78304
  if (propDeclaration && errorNode !== propDeclaration) {
78472
78305
  addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics._0_is_declared_here, symbolToString(prop)));
78473
78306
  }
@@ -78486,14 +78319,7 @@ function createTypeChecker(host) {
78486
78319
  const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfDeclaration(info.declaration)) === type.symbol ? info.declaration : void 0;
78487
78320
  const errorNode = localCheckDeclaration || localIndexDeclaration || (interfaceDeclaration && !some(getBaseTypes(type), (base) => !!getIndexInfoOfType(base, checkInfo.keyType) && !!getIndexTypeOfType(base, info.keyType)) ? interfaceDeclaration : void 0);
78488
78321
  if (errorNode && !isTypeAssignableTo(checkInfo.type, info.type)) {
78489
- error(
78490
- errorNode,
78491
- Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3,
78492
- typeToString(checkInfo.keyType),
78493
- typeToString(checkInfo.type),
78494
- typeToString(info.keyType),
78495
- typeToString(info.type)
78496
- );
78322
+ error(errorNode, Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, typeToString(checkInfo.keyType), typeToString(checkInfo.type), typeToString(info.keyType), typeToString(info.type));
78497
78323
  }
78498
78324
  }
78499
78325
  }
@@ -78774,12 +78600,7 @@ function createTypeChecker(host) {
78774
78600
  )) {
78775
78601
  issueMemberSpecificError(node, typeWithThis, baseWithThis, Diagnostics.Class_0_incorrectly_extends_base_class_1);
78776
78602
  } else {
78777
- checkTypeAssignableTo(
78778
- staticType,
78779
- getTypeWithoutSignatures(staticBaseType),
78780
- node.name || node,
78781
- Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1
78782
- );
78603
+ checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);
78783
78604
  }
78784
78605
  if (baseConstructorType.flags & 8650752 /* TypeVariable */) {
78785
78606
  if (!isMixinConstructorType(staticType)) {
@@ -79342,7 +79163,10 @@ function createTypeChecker(host) {
79342
79163
  const value = evaluate(initializer, member);
79343
79164
  if (value !== void 0) {
79344
79165
  if (isConstEnum && typeof value === "number" && !isFinite(value)) {
79345
- error(initializer, isNaN(value) ? Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value);
79166
+ error(
79167
+ initializer,
79168
+ isNaN(value) ? Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value
79169
+ );
79346
79170
  }
79347
79171
  } else if (isConstEnum) {
79348
79172
  error(initializer, Diagnostics.const_enum_member_initializers_must_be_constant_expressions);
@@ -79709,7 +79533,10 @@ function createTypeChecker(host) {
79709
79533
  }
79710
79534
  const inAmbientExternalModule = node.parent.kind === 268 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
79711
79535
  if (node.parent.kind !== 312 /* SourceFile */ && !inAmbientExternalModule) {
79712
- error(moduleName, node.kind === 278 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
79536
+ error(
79537
+ moduleName,
79538
+ node.kind === 278 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module
79539
+ );
79713
79540
  return false;
79714
79541
  }
79715
79542
  if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) {
@@ -79745,11 +79572,14 @@ function createTypeChecker(host) {
79745
79572
  if (alreadyExportedSymbol === target) {
79746
79573
  const exportingDeclaration = (_c = alreadyExportedSymbol.declarations) == null ? void 0 : _c.find(isJSDocNode);
79747
79574
  if (exportingDeclaration) {
79748
- addRelatedInfo(diag2, createDiagnosticForNode(
79749
- exportingDeclaration,
79750
- Diagnostics._0_is_automatically_exported_here,
79751
- unescapeLeadingUnderscores(alreadyExportedSymbol.escapedName)
79752
- ));
79575
+ addRelatedInfo(
79576
+ diag2,
79577
+ createDiagnosticForNode(
79578
+ exportingDeclaration,
79579
+ Diagnostics._0_is_automatically_exported_here,
79580
+ unescapeLeadingUnderscores(alreadyExportedSymbol.escapedName)
79581
+ )
79582
+ );
79753
79583
  }
79754
79584
  }
79755
79585
  } else {
@@ -80416,9 +80246,14 @@ function createTypeChecker(host) {
80416
80246
  const diagnostic = node.postfix ? Diagnostics._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1 : Diagnostics._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1;
80417
80247
  const typeNode = node.type;
80418
80248
  const type = getTypeFromTypeNode(typeNode);
80419
- grammarErrorOnNode(node, diagnostic, token, typeToString(
80420
- isJSDocNullableType(node) && !(type === neverType || type === voidType) ? getUnionType(append([type, undefinedType], node.postfix ? void 0 : nullType)) : type
80421
- ));
80249
+ grammarErrorOnNode(
80250
+ node,
80251
+ diagnostic,
80252
+ token,
80253
+ typeToString(
80254
+ isJSDocNullableType(node) && !(type === neverType || type === voidType) ? getUnionType(append([type, undefinedType], node.postfix ? void 0 : nullType)) : type
80255
+ )
80256
+ );
80422
80257
  } else {
80423
80258
  grammarErrorOnNode(node, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
80424
80259
  }
@@ -83132,10 +82967,7 @@ function createTypeChecker(host) {
83132
82967
  if (isInTopLevelContext(forInOrOfStatement)) {
83133
82968
  if (!hasParseDiagnostics(sourceFile)) {
83134
82969
  if (!isEffectiveExternalModule(sourceFile, compilerOptions)) {
83135
- diagnostics.add(createDiagnosticForNode(
83136
- forInOrOfStatement.awaitModifier,
83137
- Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module
83138
- ));
82970
+ diagnostics.add(createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module));
83139
82971
  }
83140
82972
  switch (moduleKind) {
83141
82973
  case 100 /* Node16 */:
@@ -83154,10 +82986,7 @@ function createTypeChecker(host) {
83154
82986
  }
83155
82987
  default:
83156
82988
  diagnostics.add(
83157
- createDiagnosticForNode(
83158
- forInOrOfStatement.awaitModifier,
83159
- Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher
83160
- )
82989
+ createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher)
83161
82990
  );
83162
82991
  break;
83163
82992
  }
@@ -87015,10 +86844,7 @@ function createTemplateCooked(factory2, template) {
87015
86844
  function getRawLiteral(factory2, node, currentSourceFile) {
87016
86845
  let text = node.rawText;
87017
86846
  if (text === void 0) {
87018
- Debug.assertIsDefined(
87019
- currentSourceFile,
87020
- "Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."
87021
- );
86847
+ Debug.assertIsDefined(currentSourceFile, "Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform.");
87022
86848
  text = getSourceTextOfNodeFromSourceFile(currentSourceFile, node);
87023
86849
  const isLast = node.kind === 15 /* NoSubstitutionTemplateLiteral */ || node.kind === 18 /* TemplateTail */;
87024
86850
  text = text.substring(1, text.length - (isLast ? 1 : 2));
@@ -87066,12 +86892,15 @@ function transformTypeScript(context) {
87066
86892
  return transformSourceFile(node);
87067
86893
  }
87068
86894
  function transformBundle(node) {
87069
- return factory2.createBundle(node.sourceFiles.map(transformSourceFile), mapDefined(node.prepends, (prepend) => {
87070
- if (prepend.kind === 315 /* InputFiles */) {
87071
- return createUnparsedSourceFile(prepend, "js");
87072
- }
87073
- return prepend;
87074
- }));
86895
+ return factory2.createBundle(
86896
+ node.sourceFiles.map(transformSourceFile),
86897
+ mapDefined(node.prepends, (prepend) => {
86898
+ if (prepend.kind === 315 /* InputFiles */) {
86899
+ return createUnparsedSourceFile(prepend, "js");
86900
+ }
86901
+ return prepend;
86902
+ })
86903
+ );
87075
86904
  }
87076
86905
  function transformSourceFile(node) {
87077
86906
  if (node.isDeclarationFile) {
@@ -91519,16 +91348,19 @@ function transformLegacyDecorators(context) {
91519
91348
  true
91520
91349
  );
91521
91350
  if (hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node)) {
91522
- members = setTextRange(factory2.createNodeArray([
91523
- ...members,
91524
- factory2.createClassStaticBlockDeclaration(
91525
- factory2.createBlock(
91526
- decorationStatements,
91527
- /*multiLine*/
91528
- true
91351
+ members = setTextRange(
91352
+ factory2.createNodeArray([
91353
+ ...members,
91354
+ factory2.createClassStaticBlockDeclaration(
91355
+ factory2.createBlock(
91356
+ decorationStatements,
91357
+ /*multiLine*/
91358
+ true
91359
+ )
91529
91360
  )
91530
- )
91531
- ]), members);
91361
+ ]),
91362
+ members
91363
+ );
91532
91364
  decorationStatements = void 0;
91533
91365
  }
91534
91366
  return { decorationStatements, members };
@@ -91575,16 +91407,19 @@ function transformLegacyDecorators(context) {
91575
91407
  ({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members));
91576
91408
  const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member, 32 /* Static */) || isClassStaticBlockDeclaration(member));
91577
91409
  if (assignClassAliasInStaticBlock) {
91578
- members = setTextRange(factory2.createNodeArray([
91579
- factory2.createClassStaticBlockDeclaration(
91580
- factory2.createBlock([
91581
- factory2.createExpressionStatement(
91582
- factory2.createAssignment(classAlias, factory2.createThis())
91583
- )
91584
- ])
91585
- ),
91586
- ...members
91587
- ]), members);
91410
+ members = setTextRange(
91411
+ factory2.createNodeArray([
91412
+ factory2.createClassStaticBlockDeclaration(
91413
+ factory2.createBlock([
91414
+ factory2.createExpressionStatement(
91415
+ factory2.createAssignment(classAlias, factory2.createThis())
91416
+ )
91417
+ ])
91418
+ ),
91419
+ ...members
91420
+ ]),
91421
+ members
91422
+ );
91588
91423
  }
91589
91424
  const classExpression = factory2.createClassExpression(
91590
91425
  modifiers,
@@ -91656,55 +91491,67 @@ function transformLegacyDecorators(context) {
91656
91491
  return updated;
91657
91492
  }
91658
91493
  function visitMethodDeclaration(node) {
91659
- return finishClassElement(factory2.updateMethodDeclaration(
91660
- node,
91661
- visitNodes2(node.modifiers, modifierVisitor, isModifier),
91662
- node.asteriskToken,
91663
- Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
91664
- /*questionToken*/
91665
- void 0,
91666
- /*typeParameters*/
91667
- void 0,
91668
- visitNodes2(node.parameters, visitor, isParameter),
91669
- /*type*/
91670
- void 0,
91671
- visitNode(node.body, visitor, isBlock)
91672
- ), node);
91494
+ return finishClassElement(
91495
+ factory2.updateMethodDeclaration(
91496
+ node,
91497
+ visitNodes2(node.modifiers, modifierVisitor, isModifier),
91498
+ node.asteriskToken,
91499
+ Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
91500
+ /*questionToken*/
91501
+ void 0,
91502
+ /*typeParameters*/
91503
+ void 0,
91504
+ visitNodes2(node.parameters, visitor, isParameter),
91505
+ /*type*/
91506
+ void 0,
91507
+ visitNode(node.body, visitor, isBlock)
91508
+ ),
91509
+ node
91510
+ );
91673
91511
  }
91674
91512
  function visitGetAccessorDeclaration(node) {
91675
- return finishClassElement(factory2.updateGetAccessorDeclaration(
91676
- node,
91677
- visitNodes2(node.modifiers, modifierVisitor, isModifier),
91678
- Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
91679
- visitNodes2(node.parameters, visitor, isParameter),
91680
- /*type*/
91681
- void 0,
91682
- visitNode(node.body, visitor, isBlock)
91683
- ), node);
91513
+ return finishClassElement(
91514
+ factory2.updateGetAccessorDeclaration(
91515
+ node,
91516
+ visitNodes2(node.modifiers, modifierVisitor, isModifier),
91517
+ Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
91518
+ visitNodes2(node.parameters, visitor, isParameter),
91519
+ /*type*/
91520
+ void 0,
91521
+ visitNode(node.body, visitor, isBlock)
91522
+ ),
91523
+ node
91524
+ );
91684
91525
  }
91685
91526
  function visitSetAccessorDeclaration(node) {
91686
- return finishClassElement(factory2.updateSetAccessorDeclaration(
91687
- node,
91688
- visitNodes2(node.modifiers, modifierVisitor, isModifier),
91689
- Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
91690
- visitNodes2(node.parameters, visitor, isParameter),
91691
- visitNode(node.body, visitor, isBlock)
91692
- ), node);
91527
+ return finishClassElement(
91528
+ factory2.updateSetAccessorDeclaration(
91529
+ node,
91530
+ visitNodes2(node.modifiers, modifierVisitor, isModifier),
91531
+ Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
91532
+ visitNodes2(node.parameters, visitor, isParameter),
91533
+ visitNode(node.body, visitor, isBlock)
91534
+ ),
91535
+ node
91536
+ );
91693
91537
  }
91694
91538
  function visitPropertyDeclaration(node) {
91695
91539
  if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 2 /* Ambient */)) {
91696
91540
  return void 0;
91697
91541
  }
91698
- return finishClassElement(factory2.updatePropertyDeclaration(
91699
- node,
91700
- visitNodes2(node.modifiers, modifierVisitor, isModifier),
91701
- Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
91702
- /*questionOrExclamationToken*/
91703
- void 0,
91704
- /*type*/
91705
- void 0,
91706
- visitNode(node.initializer, visitor, isExpression)
91707
- ), node);
91542
+ return finishClassElement(
91543
+ factory2.updatePropertyDeclaration(
91544
+ node,
91545
+ visitNodes2(node.modifiers, modifierVisitor, isModifier),
91546
+ Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
91547
+ /*questionOrExclamationToken*/
91548
+ void 0,
91549
+ /*type*/
91550
+ void 0,
91551
+ visitNode(node.initializer, visitor, isExpression)
91552
+ ),
91553
+ node
91554
+ );
91708
91555
  }
91709
91556
  function visitParameterDeclaration(node) {
91710
91557
  const updated = factory2.updateParameterDeclaration(
@@ -92287,7 +92134,10 @@ function transformESDecorators(context) {
92287
92134
  classInfo2.classDescriptorName = factory2.createUniqueName("_classDescriptor", 16 /* Optimistic */ | 32 /* FileLevel */);
92288
92135
  classInfo2.classExtraInitializersName = factory2.createUniqueName("_classExtraInitializers", 16 /* Optimistic */ | 32 /* FileLevel */);
92289
92136
  const needsUniqueClassThis = some(node.members, (member) => (isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member));
92290
- classInfo2.classThis = factory2.createUniqueName("_classThis", needsUniqueClassThis ? 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */ : 16 /* Optimistic */ | 32 /* FileLevel */);
92137
+ classInfo2.classThis = factory2.createUniqueName(
92138
+ "_classThis",
92139
+ needsUniqueClassThis ? 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */ : 16 /* Optimistic */ | 32 /* FileLevel */
92140
+ );
92291
92141
  classDefinitionStatements.push(
92292
92142
  createLet(classInfo2.classDecoratorsName, factory2.createArrayLiteralExpression(classDecorators)),
92293
92143
  createLet(classInfo2.classDescriptorName),
@@ -94694,9 +94544,12 @@ function transformES2018(context) {
94694
94544
  }
94695
94545
  function visitReturnStatement(node) {
94696
94546
  if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) {
94697
- return factory2.updateReturnStatement(node, createDownlevelAwait(
94698
- node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero()
94699
- ));
94547
+ return factory2.updateReturnStatement(
94548
+ node,
94549
+ createDownlevelAwait(
94550
+ node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero()
94551
+ )
94552
+ );
94700
94553
  }
94701
94554
  return visitEachChild(node, visitor, context);
94702
94555
  }
@@ -94722,7 +94575,10 @@ function transformES2018(context) {
94722
94575
  const target = e.expression;
94723
94576
  objects.push(visitNode(target, visitor, isExpression));
94724
94577
  } else {
94725
- chunkObject = append(chunkObject, e.kind === 303 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike));
94578
+ chunkObject = append(
94579
+ chunkObject,
94580
+ e.kind === 303 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike)
94581
+ );
94726
94582
  }
94727
94583
  }
94728
94584
  if (chunkObject) {
@@ -94761,13 +94617,16 @@ function transformES2018(context) {
94761
94617
  );
94762
94618
  exportedVariableStatement = false;
94763
94619
  const visited = visitEachChild(node, visitor, context);
94764
- const statement = concatenate(visited.statements, taggedTemplateStringDeclarations && [
94765
- factory2.createVariableStatement(
94766
- /*modifiers*/
94767
- void 0,
94768
- factory2.createVariableDeclarationList(taggedTemplateStringDeclarations)
94769
- )
94770
- ]);
94620
+ const statement = concatenate(
94621
+ visited.statements,
94622
+ taggedTemplateStringDeclarations && [
94623
+ factory2.createVariableStatement(
94624
+ /*modifiers*/
94625
+ void 0,
94626
+ factory2.createVariableDeclarationList(taggedTemplateStringDeclarations)
94627
+ )
94628
+ ]
94629
+ );
94771
94630
  const result = factory2.updateSourceFile(visited, setTextRange(factory2.createNodeArray(statement), node.statements));
94772
94631
  exitSubtree(ancestorFacts);
94773
94632
  return result;
@@ -95893,15 +95752,18 @@ function transformES2020(context) {
95893
95752
  right = factory2.createTempVariable(hoistVariableDeclaration);
95894
95753
  left = factory2.createAssignment(right, left);
95895
95754
  }
95896
- return setTextRange(factory2.createConditionalExpression(
95897
- createNotNullCondition(left, right),
95898
- /*questionToken*/
95899
- void 0,
95900
- right,
95901
- /*colonToken*/
95902
- void 0,
95903
- visitNode(node.right, visitor, isExpression)
95904
- ), node);
95755
+ return setTextRange(
95756
+ factory2.createConditionalExpression(
95757
+ createNotNullCondition(left, right),
95758
+ /*questionToken*/
95759
+ void 0,
95760
+ right,
95761
+ /*colonToken*/
95762
+ void 0,
95763
+ visitNode(node.right, visitor, isExpression)
95764
+ ),
95765
+ node
95766
+ );
95905
95767
  }
95906
95768
  function visitDeleteExpression(node) {
95907
95769
  return isOptionalChain(skipParentheses(node.expression)) ? setOriginalNode(visitNonOptionalExpression(
@@ -96055,13 +95917,16 @@ function transformESNext(context) {
96055
95917
  const envBinding = createEnvBinding();
96056
95918
  const bodyStatements = transformUsingDeclarations(node.statements, pos, node.statements.length, envBinding, topLevelStatements);
96057
95919
  if (exportBindings.size) {
96058
- append(topLevelStatements, factory2.createExportDeclaration(
96059
- /*modifiers*/
96060
- void 0,
96061
- /*isTypeOnly*/
96062
- false,
96063
- factory2.createNamedExports(arrayFrom(exportBindings.values()))
96064
- ));
95920
+ append(
95921
+ topLevelStatements,
95922
+ factory2.createExportDeclaration(
95923
+ /*modifiers*/
95924
+ void 0,
95925
+ /*isTypeOnly*/
95926
+ false,
95927
+ factory2.createNamedExports(arrayFrom(exportBindings.values()))
95928
+ )
95929
+ );
96065
95930
  }
96066
95931
  addRange(topLevelStatements, endLexicalEnvironment());
96067
95932
  if (exportVars.length) {
@@ -96825,7 +96690,9 @@ function transformJsx(context) {
96825
96690
  }
96826
96691
  }
96827
96692
  function hasProto(obj) {
96828
- return obj.properties.some((p) => isPropertyAssignment(p) && (isIdentifier(p.name) && idText(p.name) === "__proto__" || isStringLiteral(p.name) && p.name.text === "__proto__"));
96693
+ return obj.properties.some(
96694
+ (p) => isPropertyAssignment(p) && (isIdentifier(p.name) && idText(p.name) === "__proto__" || isStringLiteral(p.name) && p.name.text === "__proto__")
96695
+ );
96829
96696
  }
96830
96697
  function hasKeyAfterPropsSpread(node) {
96831
96698
  let spread = false;
@@ -97847,10 +97714,13 @@ function transformES2015(context) {
97847
97714
  }
97848
97715
  }
97849
97716
  if (node.flags & 256 /* IdentifierHasExtendedUnicodeEscape */) {
97850
- return setOriginalNode(setTextRange(
97851
- factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)),
97717
+ return setOriginalNode(
97718
+ setTextRange(
97719
+ factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)),
97720
+ node
97721
+ ),
97852
97722
  node
97853
- ), node);
97723
+ );
97854
97724
  }
97855
97725
  return node;
97856
97726
  }
@@ -99029,7 +98899,11 @@ function transformES2015(context) {
99029
98899
  if (node.flags & 7 /* BlockScoped */) {
99030
98900
  enableSubstitutionsForBlockScopedBindings();
99031
98901
  }
99032
- const declarations = visitNodes2(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration, isVariableDeclaration);
98902
+ const declarations = visitNodes2(
98903
+ node.declarations,
98904
+ node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration,
98905
+ isVariableDeclaration
98906
+ );
99033
98907
  const declarationList = factory2.createVariableDeclarationList(declarations);
99034
98908
  setOriginalNode(declarationList, node);
99035
98909
  setTextRange(declarationList, node);
@@ -100472,11 +100346,7 @@ function transformES2015(context) {
100472
100346
  // As we visit each element, we return one of two functions to use as the "key":
100473
100347
  // - `visitSpanOfSpreads` for one or more contiguous `...` spread expressions, i.e. `...a, ...b` in `[1, 2, ...a, ...b]`
100474
100348
  // - `visitSpanOfNonSpreads` for one or more contiguous non-spread elements, i.e. `1, 2`, in `[1, 2, ...a, ...b]`
100475
- spanMap(
100476
- elements,
100477
- partitionSpread,
100478
- (partition, visitPartition, _start, end) => visitPartition(partition, multiLine, hasTrailingComma && end === numElements)
100479
- )
100349
+ spanMap(elements, partitionSpread, (partition, visitPartition, _start, end) => visitPartition(partition, multiLine, hasTrailingComma && end === numElements))
100480
100350
  );
100481
100351
  if (segments.length === 1) {
100482
100352
  const firstSegment = segments[0];
@@ -101128,11 +100998,7 @@ function transformGenerators(context) {
101128
100998
  );
101129
100999
  break;
101130
101000
  case 212 /* ElementAccessExpression */:
101131
- target = factory2.updateElementAccessExpression(
101132
- left,
101133
- cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))),
101134
- cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression)))
101135
- );
101001
+ target = factory2.updateElementAccessExpression(left, cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression))));
101136
101002
  break;
101137
101003
  default:
101138
101004
  target = Debug.checkDefined(visitNode(left, visitor, isExpression));
@@ -101167,12 +101033,7 @@ function transformGenerators(context) {
101167
101033
  } else if (node.operatorToken.kind === 28 /* CommaToken */) {
101168
101034
  return visitCommaExpression(node);
101169
101035
  }
101170
- return factory2.updateBinaryExpression(
101171
- node,
101172
- cacheExpression(Debug.checkDefined(visitNode(node.left, visitor, isExpression))),
101173
- node.operatorToken,
101174
- Debug.checkDefined(visitNode(node.right, visitor, isExpression))
101175
- );
101036
+ return factory2.updateBinaryExpression(node, cacheExpression(Debug.checkDefined(visitNode(node.left, visitor, isExpression))), node.operatorToken, Debug.checkDefined(visitNode(node.right, visitor, isExpression)));
101176
101037
  }
101177
101038
  return visitEachChild(node, visitor, context);
101178
101039
  }
@@ -101380,11 +101241,7 @@ function transformGenerators(context) {
101380
101241
  }
101381
101242
  function visitElementAccessExpression(node) {
101382
101243
  if (containsYield(node.argumentExpression)) {
101383
- return factory2.updateElementAccessExpression(
101384
- node,
101385
- cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression))),
101386
- Debug.checkDefined(visitNode(node.argumentExpression, visitor, isExpression))
101387
- );
101244
+ return factory2.updateElementAccessExpression(node, cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression))), Debug.checkDefined(visitNode(node.argumentExpression, visitor, isExpression)));
101388
101245
  }
101389
101246
  return visitEachChild(node, visitor, context);
101390
101247
  }
@@ -101742,12 +101599,7 @@ function transformGenerators(context) {
101742
101599
  for (const variable of initializer.declarations) {
101743
101600
  hoistVariableDeclaration(variable.name);
101744
101601
  }
101745
- node = factory2.updateForInStatement(
101746
- node,
101747
- initializer.declarations[0].name,
101748
- Debug.checkDefined(visitNode(node.expression, visitor, isExpression)),
101749
- Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock))
101750
- );
101602
+ node = factory2.updateForInStatement(node, initializer.declarations[0].name, Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)));
101751
101603
  } else {
101752
101604
  node = visitEachChild(node, visitor, context);
101753
101605
  }
@@ -102908,12 +102760,14 @@ function transformModule(context) {
102908
102760
  // Add the dependency array argument:
102909
102761
  //
102910
102762
  // ["require", "exports", module1", "module2", ...]
102911
- factory2.createArrayLiteralExpression(jsonSourceFile ? emptyArray : [
102912
- factory2.createStringLiteral("require"),
102913
- factory2.createStringLiteral("exports"),
102914
- ...aliasedModuleNames,
102915
- ...unaliasedModuleNames
102916
- ]),
102763
+ factory2.createArrayLiteralExpression(
102764
+ jsonSourceFile ? emptyArray : [
102765
+ factory2.createStringLiteral("require"),
102766
+ factory2.createStringLiteral("exports"),
102767
+ ...aliasedModuleNames,
102768
+ ...unaliasedModuleNames
102769
+ ]
102770
+ ),
102917
102771
  // Add the module body function argument:
102918
102772
  //
102919
102773
  // function (require, exports, module1, module2) ...
@@ -103639,22 +103493,25 @@ function transformModule(context) {
103639
103493
  );
103640
103494
  } else {
103641
103495
  const temp = factory2.createTempVariable(hoistVariableDeclaration);
103642
- return factory2.createComma(factory2.createAssignment(temp, arg), factory2.createConditionalExpression(
103643
- /*condition*/
103644
- factory2.createIdentifier("__syncRequire"),
103645
- /*questionToken*/
103646
- void 0,
103647
- /*whenTrue*/
103648
- createImportCallExpressionCommonJS(
103649
- temp,
103650
- /*isInlineable*/
103651
- true
103652
- ),
103653
- /*colonToken*/
103654
- void 0,
103655
- /*whenFalse*/
103656
- createImportCallExpressionAMD(temp, containsLexicalThis)
103657
- ));
103496
+ return factory2.createComma(
103497
+ factory2.createAssignment(temp, arg),
103498
+ factory2.createConditionalExpression(
103499
+ /*condition*/
103500
+ factory2.createIdentifier("__syncRequire"),
103501
+ /*questionToken*/
103502
+ void 0,
103503
+ /*whenTrue*/
103504
+ createImportCallExpressionCommonJS(
103505
+ temp,
103506
+ /*isInlineable*/
103507
+ true
103508
+ ),
103509
+ /*colonToken*/
103510
+ void 0,
103511
+ /*whenFalse*/
103512
+ createImportCallExpressionAMD(temp, containsLexicalThis)
103513
+ )
103514
+ );
103658
103515
  }
103659
103516
  }
103660
103517
  function createImportCallExpressionAMD(arg, containsLexicalThis) {
@@ -104095,7 +103952,10 @@ function transformModule(context) {
104095
103952
  factory2.createExpressionStatement(
104096
103953
  createExportExpression(
104097
103954
  factory2.cloneNode(node.exportClause.name),
104098
- getHelperExpressionForExport(node, moduleKind !== 2 /* AMD */ ? createRequireCall(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory2.createIdentifier(idText(node.exportClause.name)))
103955
+ getHelperExpressionForExport(
103956
+ node,
103957
+ moduleKind !== 2 /* AMD */ ? createRequireCall(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory2.createIdentifier(idText(node.exportClause.name))
103958
+ )
104099
103959
  )
104100
103960
  ),
104101
103961
  node
@@ -104487,21 +104347,24 @@ function transformModule(context) {
104487
104347
  factory2.createStringLiteralFromNode(name),
104488
104348
  factory2.createObjectLiteralExpression([
104489
104349
  factory2.createPropertyAssignment("enumerable", factory2.createTrue()),
104490
- factory2.createPropertyAssignment("get", factory2.createFunctionExpression(
104491
- /*modifiers*/
104492
- void 0,
104493
- /*asteriskToken*/
104494
- void 0,
104495
- /*name*/
104496
- void 0,
104497
- /*typeParameters*/
104498
- void 0,
104499
- /*parameters*/
104500
- [],
104501
- /*type*/
104502
- void 0,
104503
- factory2.createBlock([factory2.createReturnStatement(value)])
104504
- ))
104350
+ factory2.createPropertyAssignment(
104351
+ "get",
104352
+ factory2.createFunctionExpression(
104353
+ /*modifiers*/
104354
+ void 0,
104355
+ /*asteriskToken*/
104356
+ void 0,
104357
+ /*name*/
104358
+ void 0,
104359
+ /*typeParameters*/
104360
+ void 0,
104361
+ /*parameters*/
104362
+ [],
104363
+ /*type*/
104364
+ void 0,
104365
+ factory2.createBlock([factory2.createReturnStatement(value)])
104366
+ )
104367
+ )
104505
104368
  ])
104506
104369
  ]
104507
104370
  ) : factory2.createAssignment(
@@ -104876,10 +104739,7 @@ function transformSystemModule(context) {
104876
104739
  const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(512 /* Async */) : void 0;
104877
104740
  const moduleObject = factory2.createObjectLiteralExpression(
104878
104741
  [
104879
- factory2.createPropertyAssignment(
104880
- "setters",
104881
- createSettersArray(exportStarFunction, dependencyGroups)
104882
- ),
104742
+ factory2.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)),
104883
104743
  factory2.createPropertyAssignment(
104884
104744
  "execute",
104885
104745
  factory2.createFunctionExpression(
@@ -106199,18 +106059,21 @@ function transformECMAScriptModule(context) {
106199
106059
  }
106200
106060
  function appendExportsOfImportEqualsDeclaration(statements, node) {
106201
106061
  if (hasSyntacticModifier(node, 1 /* Export */)) {
106202
- statements = append(statements, factory2.createExportDeclaration(
106203
- /*modifiers*/
106204
- void 0,
106205
- node.isTypeOnly,
106206
- factory2.createNamedExports([factory2.createExportSpecifier(
106207
- /*isTypeOnly*/
106208
- false,
106209
- /*propertyName*/
106062
+ statements = append(
106063
+ statements,
106064
+ factory2.createExportDeclaration(
106065
+ /*modifiers*/
106210
106066
  void 0,
106211
- idText(node.name)
106212
- )])
106213
- ));
106067
+ node.isTypeOnly,
106068
+ factory2.createNamedExports([factory2.createExportSpecifier(
106069
+ /*isTypeOnly*/
106070
+ false,
106071
+ /*propertyName*/
106072
+ void 0,
106073
+ idText(node.name)
106074
+ )])
106075
+ )
106076
+ );
106214
106077
  }
106215
106078
  return statements;
106216
106079
  }
@@ -106737,20 +106600,9 @@ function transformDeclarations(context) {
106737
106600
  const errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult);
106738
106601
  if (errorInfo) {
106739
106602
  if (errorInfo.typeName) {
106740
- context.addDiagnostic(createDiagnosticForNode(
106741
- symbolAccessibilityResult.errorNode || errorInfo.errorNode,
106742
- errorInfo.diagnosticMessage,
106743
- getTextOfNode(errorInfo.typeName),
106744
- symbolAccessibilityResult.errorSymbolName,
106745
- symbolAccessibilityResult.errorModuleName
106746
- ));
106603
+ context.addDiagnostic(createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, getTextOfNode(errorInfo.typeName), symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName));
106747
106604
  } else {
106748
- context.addDiagnostic(createDiagnosticForNode(
106749
- symbolAccessibilityResult.errorNode || errorInfo.errorNode,
106750
- errorInfo.diagnosticMessage,
106751
- symbolAccessibilityResult.errorSymbolName,
106752
- symbolAccessibilityResult.errorModuleName
106753
- ));
106605
+ context.addDiagnostic(createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName));
106754
106606
  }
106755
106607
  return true;
106756
106608
  }
@@ -106787,41 +106639,22 @@ function transformDeclarations(context) {
106787
106639
  }
106788
106640
  function reportInaccessibleUniqueSymbolError() {
106789
106641
  if (errorNameNode || errorFallbackNode) {
106790
- context.addDiagnostic(createDiagnosticForNode(
106791
- errorNameNode || errorFallbackNode,
106792
- Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,
106793
- errorDeclarationNameWithFallback(),
106794
- "unique symbol"
106795
- ));
106642
+ context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "unique symbol"));
106796
106643
  }
106797
106644
  }
106798
106645
  function reportCyclicStructureError() {
106799
106646
  if (errorNameNode || errorFallbackNode) {
106800
- context.addDiagnostic(createDiagnosticForNode(
106801
- errorNameNode || errorFallbackNode,
106802
- Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary,
106803
- errorDeclarationNameWithFallback()
106804
- ));
106647
+ context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, errorDeclarationNameWithFallback()));
106805
106648
  }
106806
106649
  }
106807
106650
  function reportInaccessibleThisError() {
106808
106651
  if (errorNameNode || errorFallbackNode) {
106809
- context.addDiagnostic(createDiagnosticForNode(
106810
- errorNameNode || errorFallbackNode,
106811
- Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,
106812
- errorDeclarationNameWithFallback(),
106813
- "this"
106814
- ));
106652
+ context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "this"));
106815
106653
  }
106816
106654
  }
106817
106655
  function reportLikelyUnsafeImportRequiredError(specifier) {
106818
106656
  if (errorNameNode || errorFallbackNode) {
106819
- context.addDiagnostic(createDiagnosticForNode(
106820
- errorNameNode || errorFallbackNode,
106821
- Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary,
106822
- errorDeclarationNameWithFallback(),
106823
- specifier
106824
- ));
106657
+ context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), specifier));
106825
106658
  }
106826
106659
  }
106827
106660
  function reportTruncationError() {
@@ -106871,9 +106704,8 @@ function transformDeclarations(context) {
106871
106704
  refs = /* @__PURE__ */ new Map();
106872
106705
  libs2 = /* @__PURE__ */ new Map();
106873
106706
  let hasNoDefaultLib = false;
106874
- const bundle = factory2.createBundle(map(
106875
- node.sourceFiles,
106876
- (sourceFile) => {
106707
+ const bundle = factory2.createBundle(
106708
+ map(node.sourceFiles, (sourceFile) => {
106877
106709
  if (sourceFile.isDeclarationFile)
106878
106710
  return void 0;
106879
106711
  hasNoDefaultLib = hasNoDefaultLib || sourceFile.hasNoDefaultLib;
@@ -106931,18 +106763,19 @@ function transformDeclarations(context) {
106931
106763
  /*libReferences*/
106932
106764
  []
106933
106765
  );
106934
- }
106935
- ), mapDefined(node.prepends, (prepend) => {
106936
- if (prepend.kind === 315 /* InputFiles */) {
106937
- const sourceFile = createUnparsedSourceFile(prepend, "dts", stripInternal);
106938
- hasNoDefaultLib = hasNoDefaultLib || !!sourceFile.hasNoDefaultLib;
106939
- collectReferences(sourceFile, refs);
106940
- recordTypeReferenceDirectivesIfNecessary(map(sourceFile.typeReferenceDirectives, (ref) => [ref.fileName, ref.resolutionMode]));
106941
- collectLibs(sourceFile, libs2);
106942
- return sourceFile;
106943
- }
106944
- return prepend;
106945
- }));
106766
+ }),
106767
+ mapDefined(node.prepends, (prepend) => {
106768
+ if (prepend.kind === 315 /* InputFiles */) {
106769
+ const sourceFile = createUnparsedSourceFile(prepend, "dts", stripInternal);
106770
+ hasNoDefaultLib = hasNoDefaultLib || !!sourceFile.hasNoDefaultLib;
106771
+ collectReferences(sourceFile, refs);
106772
+ recordTypeReferenceDirectivesIfNecessary(map(sourceFile.typeReferenceDirectives, (ref) => [ref.fileName, ref.resolutionMode]));
106773
+ collectLibs(sourceFile, libs2);
106774
+ return sourceFile;
106775
+ }
106776
+ return prepend;
106777
+ })
106778
+ );
106946
106779
  bundle.syntheticFileReferences = [];
106947
106780
  bundle.syntheticTypeReferences = getFileReferencesForUsedTypeReferences();
106948
106781
  bundle.syntheticLibReferences = getLibReferences();
@@ -107358,25 +107191,37 @@ function transformDeclarations(context) {
107358
107191
  }
107359
107192
  const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
107360
107193
  if (!decl.importClause.namedBindings) {
107361
- return visibleDefaultBinding && factory2.updateImportDeclaration(decl, decl.modifiers, factory2.updateImportClause(
107362
- decl.importClause,
107363
- decl.importClause.isTypeOnly,
107364
- visibleDefaultBinding,
107365
- /*namedBindings*/
107366
- void 0
107367
- ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
107194
+ return visibleDefaultBinding && factory2.updateImportDeclaration(
107195
+ decl,
107196
+ decl.modifiers,
107197
+ factory2.updateImportClause(
107198
+ decl.importClause,
107199
+ decl.importClause.isTypeOnly,
107200
+ visibleDefaultBinding,
107201
+ /*namedBindings*/
107202
+ void 0
107203
+ ),
107204
+ rewriteModuleSpecifier(decl, decl.moduleSpecifier),
107205
+ getResolutionModeOverrideForClauseInNightly(decl.assertClause)
107206
+ );
107368
107207
  }
107369
107208
  if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
107370
107209
  const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : (
107371
107210
  /*namedBindings*/
107372
107211
  void 0
107373
107212
  );
107374
- return visibleDefaultBinding || namedBindings ? factory2.updateImportDeclaration(decl, decl.modifiers, factory2.updateImportClause(
107375
- decl.importClause,
107376
- decl.importClause.isTypeOnly,
107377
- visibleDefaultBinding,
107378
- namedBindings
107379
- ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)) : void 0;
107213
+ return visibleDefaultBinding || namedBindings ? factory2.updateImportDeclaration(
107214
+ decl,
107215
+ decl.modifiers,
107216
+ factory2.updateImportClause(
107217
+ decl.importClause,
107218
+ decl.importClause.isTypeOnly,
107219
+ visibleDefaultBinding,
107220
+ namedBindings
107221
+ ),
107222
+ rewriteModuleSpecifier(decl, decl.moduleSpecifier),
107223
+ getResolutionModeOverrideForClauseInNightly(decl.assertClause)
107224
+ ) : void 0;
107380
107225
  }
107381
107226
  const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
107382
107227
  if (bindingList && bindingList.length || visibleDefaultBinding) {
@@ -108034,13 +107879,16 @@ function transformDeclarations(context) {
108034
107879
  return;
108035
107880
  getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(param);
108036
107881
  if (param.name.kind === 80 /* Identifier */) {
108037
- return preserveJsDoc(factory2.createPropertyDeclaration(
108038
- ensureModifiers(param),
108039
- param.name,
108040
- param.questionToken,
108041
- ensureType(param, param.type),
108042
- ensureNoInitializer(param)
108043
- ), param);
107882
+ return preserveJsDoc(
107883
+ factory2.createPropertyDeclaration(
107884
+ ensureModifiers(param),
107885
+ param.name,
107886
+ param.questionToken,
107887
+ ensureType(param, param.type),
107888
+ ensureNoInitializer(param)
107889
+ ),
107890
+ param
107891
+ );
108044
107892
  } else {
108045
107893
  return walkBindingPattern(param.name);
108046
107894
  }
@@ -108116,14 +107964,17 @@ function transformDeclarations(context) {
108116
107964
  }
108117
107965
  return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 106 /* NullKeyword */)), visitDeclarationSubtree, isExpressionWithTypeArguments));
108118
107966
  }));
108119
- return [statement, cleanup(factory2.updateClassDeclaration(
108120
- input,
108121
- modifiers,
108122
- input.name,
108123
- typeParameters,
108124
- heritageClauses,
108125
- members
108126
- ))];
107967
+ return [
107968
+ statement,
107969
+ cleanup(factory2.updateClassDeclaration(
107970
+ input,
107971
+ modifiers,
107972
+ input.name,
107973
+ typeParameters,
107974
+ heritageClauses,
107975
+ members
107976
+ ))
107977
+ ];
108127
107978
  } else {
108128
107979
  const heritageClauses = transformHeritageClauses(input.heritageClauses);
108129
107980
  return cleanup(factory2.updateClassDeclaration(
@@ -108140,13 +107991,18 @@ function transformDeclarations(context) {
108140
107991
  return cleanup(transformVariableStatement(input));
108141
107992
  }
108142
107993
  case 266 /* EnumDeclaration */: {
108143
- return cleanup(factory2.updateEnumDeclaration(input, factory2.createNodeArray(ensureModifiers(input)), input.name, factory2.createNodeArray(mapDefined(input.members, (m) => {
108144
- if (shouldStripInternal(m))
108145
- return;
108146
- const constValue = resolver.getConstantValue(m);
108147
- const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constValue))) : factory2.createNumericLiteral(constValue);
108148
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
108149
- }))));
107994
+ return cleanup(factory2.updateEnumDeclaration(
107995
+ input,
107996
+ factory2.createNodeArray(ensureModifiers(input)),
107997
+ input.name,
107998
+ factory2.createNodeArray(mapDefined(input.members, (m) => {
107999
+ if (shouldStripInternal(m))
108000
+ return;
108001
+ const constValue = resolver.getConstantValue(m);
108002
+ const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constValue))) : factory2.createNumericLiteral(constValue);
108003
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
108004
+ }))
108005
+ ));
108150
108006
  }
108151
108007
  }
108152
108008
  return Debug.assertNever(input, `Unhandled top-level node in declaration emit: ${Debug.formatSyntaxKind(input.kind)}`);
@@ -108270,9 +108126,19 @@ function transformDeclarations(context) {
108270
108126
  return accessorType;
108271
108127
  }
108272
108128
  function transformHeritageClauses(nodes) {
108273
- return factory2.createNodeArray(filter(map(nodes, (clause) => factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => {
108274
- return isEntityNameExpression(t.expression) || clause.token === 96 /* ExtendsKeyword */ && t.expression.kind === 106 /* NullKeyword */;
108275
- })), visitDeclarationSubtree, isExpressionWithTypeArguments))), (clause) => clause.types && !!clause.types.length));
108129
+ return factory2.createNodeArray(filter(
108130
+ map(nodes, (clause) => factory2.updateHeritageClause(
108131
+ clause,
108132
+ visitNodes2(
108133
+ factory2.createNodeArray(filter(clause.types, (t) => {
108134
+ return isEntityNameExpression(t.expression) || clause.token === 96 /* ExtendsKeyword */ && t.expression.kind === 106 /* NullKeyword */;
108135
+ })),
108136
+ visitDeclarationSubtree,
108137
+ isExpressionWithTypeArguments
108138
+ )
108139
+ )),
108140
+ (clause) => clause.types && !!clause.types.length
108141
+ ));
108276
108142
  }
108277
108143
  }
108278
108144
  function isAlwaysType(node) {
@@ -110609,14 +110475,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
110609
110475
  nonEscapingWrite(`}`);
110610
110476
  }
110611
110477
  function emitTabStop(hint, node, snippet) {
110612
- Debug.assert(
110613
- node.kind === 242 /* EmptyStatement */,
110614
- `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`
110615
- );
110616
- Debug.assert(
110617
- hint !== 5 /* EmbeddedStatement */,
110618
- `A tab stop cannot be attached to an embedded statement.`
110619
- );
110478
+ Debug.assert(node.kind === 242 /* EmptyStatement */, `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`);
110479
+ Debug.assert(hint !== 5 /* EmbeddedStatement */, `A tab stop cannot be attached to an embedded statement.`);
110620
110480
  nonEscapingWrite(`$${snippet.order}`);
110621
110481
  }
110622
110482
  function emitIdentifier(node) {
@@ -112041,7 +111901,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
112041
111901
  emitTokenWithComment(90 /* DefaultKeyword */, nextPos, writeKeyword, node);
112042
111902
  }
112043
111903
  writeSpace();
112044
- emitExpression(node.expression, node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator(64 /* EqualsToken */) : parenthesizer.parenthesizeExpressionOfExportDefault);
111904
+ emitExpression(
111905
+ node.expression,
111906
+ node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator(64 /* EqualsToken */) : parenthesizer.parenthesizeExpressionOfExportDefault
111907
+ );
112045
111908
  writeTrailingSemicolon();
112046
111909
  }
112047
111910
  function emitExportDeclaration(node) {
@@ -118226,19 +118089,11 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118226
118089
  case 1 /* SourceFromProjectReference */:
118227
118090
  case 2 /* OutputFromProjectReference */:
118228
118091
  const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]);
118229
- const referenceInfo = forEachProjectReference(
118230
- projectReferences,
118231
- resolvedProjectReferences,
118232
- (resolvedRef, parent, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent == null ? void 0 : parent.sourceFile) || options.configFile, index: index2 } : void 0
118233
- );
118092
+ const referenceInfo = forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent == null ? void 0 : parent.sourceFile) || options.configFile, index: index2 } : void 0);
118234
118093
  if (!referenceInfo)
118235
118094
  return void 0;
118236
118095
  const { sourceFile, index } = referenceInfo;
118237
- const referencesSyntax = forEachTsConfigPropArray(
118238
- sourceFile,
118239
- "references",
118240
- (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0
118241
- );
118096
+ const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
118242
118097
  return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
118243
118098
  sourceFile,
118244
118099
  referencesSyntax.elements[index],
@@ -118378,11 +118233,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118378
118233
  );
118379
118234
  }
118380
118235
  function createDiagnosticForReference(sourceFile, index, message, ...args) {
118381
- const referencesSyntax = forEachTsConfigPropArray(
118382
- sourceFile || options.configFile,
118383
- "references",
118384
- (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0
118385
- );
118236
+ const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
118386
118237
  if (referencesSyntax && referencesSyntax.elements.length > index) {
118387
118238
  programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, ...args));
118388
118239
  } else {
@@ -118976,13 +118827,16 @@ var BuilderState;
118976
118827
  sourceFile,
118977
118828
  (fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
118978
118829
  Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
118979
- onNewSignature(computeSignatureWithDiagnostics(
118980
- programOfThisState,
118981
- sourceFile,
118982
- text,
118983
- host,
118984
- data
118985
- ), sourceFiles);
118830
+ onNewSignature(
118831
+ computeSignatureWithDiagnostics(
118832
+ programOfThisState,
118833
+ sourceFile,
118834
+ text,
118835
+ host,
118836
+ data
118837
+ ),
118838
+ sourceFiles
118839
+ );
118986
118840
  },
118987
118841
  cancellationToken,
118988
118842
  /*emitOnly*/
@@ -119494,10 +119348,7 @@ function removeDiagnosticsOfLibraryFiles(state) {
119494
119348
  state.cleanedDiagnosticsOfLibFiles = true;
119495
119349
  const program = Debug.checkDefined(state.program);
119496
119350
  const options = program.getCompilerOptions();
119497
- forEach(
119498
- program.getSourceFiles(),
119499
- (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath)
119500
- );
119351
+ forEach(program.getSourceFiles(), (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
119501
119352
  }
119502
119353
  }
119503
119354
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
@@ -119565,12 +119416,14 @@ function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, hos
119565
119416
  state.program,
119566
119417
  /*firstSourceFile*/
119567
119418
  void 0
119568
- ).forEach((file) => handleDtsMayChangeOf(
119569
- state,
119570
- file.resolvedPath,
119571
- cancellationToken,
119572
- host
119573
- ));
119419
+ ).forEach(
119420
+ (file) => handleDtsMayChangeOf(
119421
+ state,
119422
+ file.resolvedPath,
119423
+ cancellationToken,
119424
+ host
119425
+ )
119426
+ );
119574
119427
  removeDiagnosticsOfLibraryFiles(state);
119575
119428
  return true;
119576
119429
  }
@@ -119603,16 +119456,13 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
119603
119456
  if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, host))
119604
119457
  return true;
119605
119458
  const references = state.referencedMap.getKeys(exportedFromPath);
119606
- return references && forEachKey(
119607
- references,
119608
- (filePath) => handleDtsMayChangeOfFileAndExportsOfFile(
119609
- state,
119610
- filePath,
119611
- seenFileAndExportsOfFile,
119612
- cancellationToken,
119613
- host
119614
- )
119615
- );
119459
+ return references && forEachKey(references, (filePath) => handleDtsMayChangeOfFileAndExportsOfFile(
119460
+ state,
119461
+ filePath,
119462
+ seenFileAndExportsOfFile,
119463
+ cancellationToken,
119464
+ host
119465
+ ));
119616
119466
  });
119617
119467
  }
119618
119468
  function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, host) {
@@ -119720,11 +119570,13 @@ function getBuildInfo2(state, bundle) {
119720
119570
  if (!isJsonSourceFile(file) && sourceFileMayBeEmitted(file, state.program)) {
119721
119571
  const emitSignature = (_b2 = state.emitSignatures) == null ? void 0 : _b2.get(key);
119722
119572
  if (emitSignature !== actualSignature) {
119723
- (emitSignatures || (emitSignatures = [])).push(emitSignature === void 0 ? fileId : (
119724
- // There is no emit, encode as false
119725
- // fileId, signature: emptyArray if signature only differs in dtsMap option than our own compilerOptions otherwise EmitSignature
119726
- [fileId, !isString(emitSignature) && emitSignature[0] === actualSignature ? emptyArray : emitSignature]
119727
- ));
119573
+ (emitSignatures || (emitSignatures = [])).push(
119574
+ emitSignature === void 0 ? fileId : (
119575
+ // There is no emit, encode as false
119576
+ // fileId, signature: emptyArray if signature only differs in dtsMap option than our own compilerOptions otherwise EmitSignature
119577
+ [fileId, !isString(emitSignature) && emitSignature[0] === actualSignature ? emptyArray : emitSignature]
119578
+ )
119579
+ );
119728
119580
  }
119729
119581
  }
119730
119582
  }
@@ -119978,9 +119830,7 @@ function computeSignatureWithDiagnostics(program, sourceFile, text, host, data)
119978
119830
  text = getTextHandlingSourceMapForSignature(text, data);
119979
119831
  let sourceFileDirectory;
119980
119832
  if ((_a = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a.length) {
119981
- text += data.diagnostics.map(
119982
- (diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}`
119983
- ).join("\n");
119833
+ text += data.diagnostics.map((diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}`).join("\n");
119984
119834
  }
119985
119835
  return (host.createHash ?? generateDjb2Hash)(text);
119986
119836
  function flattenDiagnosticMessageText2(diagnostic) {
@@ -120387,9 +120237,7 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
120387
120237
  return void 0;
120388
120238
  }
120389
120239
  const map2 = BuilderState.createManyToManyPathMap();
120390
- referenceMap.forEach(
120391
- ([fileId, fileIdListId]) => map2.set(toFilePath(fileId), toFilePathsSet(fileIdListId))
120392
- );
120240
+ referenceMap.forEach(([fileId, fileIdListId]) => map2.set(toFilePath(fileId), toFilePathsSet(fileIdListId)));
120393
120241
  return map2;
120394
120242
  }
120395
120243
  }
@@ -120879,11 +120727,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
120879
120727
  seenNamesInFile.set(name, mode, true);
120880
120728
  resolvedModules.push(resolution);
120881
120729
  }
120882
- reusedNames == null ? void 0 : reusedNames.forEach((entry) => seenNamesInFile.set(
120883
- loader.nameAndMode.getName(entry),
120884
- loader.nameAndMode.getMode(entry, containingSourceFile),
120885
- true
120886
- ));
120730
+ reusedNames == null ? void 0 : reusedNames.forEach(
120731
+ (entry) => seenNamesInFile.set(
120732
+ loader.nameAndMode.getName(entry),
120733
+ loader.nameAndMode.getMode(entry, containingSourceFile),
120734
+ true
120735
+ )
120736
+ );
120887
120737
  if (resolutionsInFile.size() !== seenNamesInFile.size()) {
120888
120738
  resolutionsInFile.forEach((resolution, name, mode) => {
120889
120739
  if (!seenNamesInFile.has(name, mode)) {
@@ -121512,10 +121362,7 @@ function getFilesInErrorForSummary(diagnostics) {
121512
121362
  if (fileName === void 0) {
121513
121363
  return void 0;
121514
121364
  }
121515
- const diagnosticForFileName = find(
121516
- diagnostics,
121517
- (diagnostic) => diagnostic.file !== void 0 && diagnostic.file.fileName === fileName
121518
- );
121365
+ const diagnosticForFileName = find(diagnostics, (diagnostic) => diagnostic.file !== void 0 && diagnostic.file.fileName === fileName);
121519
121366
  if (diagnosticForFileName !== void 0) {
121520
121367
  const { line } = getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start);
121521
121368
  return {
@@ -122534,14 +122381,16 @@ function createWatchProgram(host) {
122534
122381
  }
122535
122382
  function parseConfigFile2() {
122536
122383
  Debug.assert(configFileName);
122537
- setConfigFileParsingResult(getParsedCommandLineOfConfigFile(
122538
- configFileName,
122539
- optionsToExtendForConfigFile,
122540
- parseConfigFileHost,
122541
- extendedConfigCache || (extendedConfigCache = /* @__PURE__ */ new Map()),
122542
- watchOptionsToExtend,
122543
- extraFileExtensions
122544
- ));
122384
+ setConfigFileParsingResult(
122385
+ getParsedCommandLineOfConfigFile(
122386
+ configFileName,
122387
+ optionsToExtendForConfigFile,
122388
+ parseConfigFileHost,
122389
+ extendedConfigCache || (extendedConfigCache = /* @__PURE__ */ new Map()),
122390
+ watchOptionsToExtend,
122391
+ extraFileExtensions
122392
+ )
122393
+ );
122545
122394
  }
122546
122395
  function setConfigFileParsingResult(configFileParseResult) {
122547
122396
  rootFileNames = configFileParseResult.fileNames;
@@ -123379,10 +123228,13 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
123379
123228
  config.projectReferences
123380
123229
  );
123381
123230
  if (state.watch) {
123382
- state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && map(
123383
- state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
123384
- ([path, data]) => [state.host.realpath && data ? toPath2(state, state.host.realpath(path)) : path, data]
123385
- ));
123231
+ state.lastCachedPackageJsonLookups.set(
123232
+ projectPath,
123233
+ state.moduleResolutionCache && map(
123234
+ state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
123235
+ ([path, data]) => [state.host.realpath && data ? toPath2(state, state.host.realpath(path)) : path, data]
123236
+ )
123237
+ );
123386
123238
  state.builderPrograms.set(projectPath, program);
123387
123239
  }
123388
123240
  step++;
@@ -124436,15 +124288,18 @@ function buildNextInvalidatedProjectWorker(state, changeDetected) {
124436
124288
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
124437
124289
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
124438
124290
  return;
124439
- state.allWatchedConfigFiles.set(resolvedPath, watchFile(
124440
- state,
124441
- resolved,
124442
- () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 2 /* Full */),
124443
- 2e3 /* High */,
124444
- parsed == null ? void 0 : parsed.watchOptions,
124445
- WatchType.ConfigFile,
124446
- resolved
124447
- ));
124291
+ state.allWatchedConfigFiles.set(
124292
+ resolvedPath,
124293
+ watchFile(
124294
+ state,
124295
+ resolved,
124296
+ () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 2 /* Full */),
124297
+ 2e3 /* High */,
124298
+ parsed == null ? void 0 : parsed.watchOptions,
124299
+ WatchType.ConfigFile,
124300
+ resolved
124301
+ )
124302
+ );
124448
124303
  }
124449
124304
  function watchExtendedConfigFiles(state, resolvedPath, parsed) {
124450
124305
  updateSharedExtendedConfigFileWatcher(
@@ -125724,11 +125579,7 @@ function enableStatisticsAndTracing(system, compilerOptions, isBuildMode) {
125724
125579
  enable(system);
125725
125580
  }
125726
125581
  if (canTrace(system, compilerOptions)) {
125727
- startTracing(
125728
- isBuildMode ? "build" : "project",
125729
- compilerOptions.generateTrace,
125730
- compilerOptions.configFilePath
125731
- );
125582
+ startTracing(isBuildMode ? "build" : "project", compilerOptions.generateTrace, compilerOptions.configFilePath);
125732
125583
  }
125733
125584
  }
125734
125585
  function isSolutionMarkOrMeasure(name) {