@typescript-deploys/pr-build 5.0.0-pr-51492-2 → 5.0.0-pr-50996-9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-insiders.20221111`;
26
+ var version = `${versionMajorMinor}.0-insiders.20221123`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -1294,15 +1294,9 @@ function isNodeLikeSystem() {
1294
1294
  // src/compiler/debug.ts
1295
1295
  var Debug;
1296
1296
  ((Debug2) => {
1297
- let typeScriptVersion2;
1298
1297
  let currentAssertionLevel = 0 /* None */;
1299
1298
  Debug2.currentLogLevel = 2 /* Warning */;
1300
1299
  Debug2.isDebugging = false;
1301
- Debug2.enableDeprecationWarnings = true;
1302
- function getTypeScriptVersion() {
1303
- return typeScriptVersion2 != null ? typeScriptVersion2 : typeScriptVersion2 = new Version(version);
1304
- }
1305
- Debug2.getTypeScriptVersion = getTypeScriptVersion;
1306
1300
  function shouldLog(level) {
1307
1301
  return Debug2.currentLogLevel <= level;
1308
1302
  }
@@ -1818,52 +1812,6 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1818
1812
  isDebugInfoEnabled = true;
1819
1813
  }
1820
1814
  Debug2.enableDebugInfo = enableDebugInfo;
1821
- function formatDeprecationMessage(name, error, errorAfter, since, message) {
1822
- let deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
1823
- deprecationMessage += `'${name}' `;
1824
- deprecationMessage += since ? `has been deprecated since v${since}` : "is deprecated";
1825
- deprecationMessage += error ? " and can no longer be used." : errorAfter ? ` and will no longer be usable after v${errorAfter}.` : ".";
1826
- deprecationMessage += message ? ` ${formatStringFromArgs(message, [name], 0)}` : "";
1827
- return deprecationMessage;
1828
- }
1829
- function createErrorDeprecation(name, errorAfter, since, message) {
1830
- const deprecationMessage = formatDeprecationMessage(name, true, errorAfter, since, message);
1831
- return () => {
1832
- throw new TypeError(deprecationMessage);
1833
- };
1834
- }
1835
- function createWarningDeprecation(name, errorAfter, since, message) {
1836
- let hasWrittenDeprecation = false;
1837
- return () => {
1838
- if (Debug2.enableDeprecationWarnings && !hasWrittenDeprecation) {
1839
- log.warn(formatDeprecationMessage(name, false, errorAfter, since, message));
1840
- hasWrittenDeprecation = true;
1841
- }
1842
- };
1843
- }
1844
- function createDeprecation(name, options = {}) {
1845
- var _a2, _b;
1846
- const version2 = typeof options.typeScriptVersion === "string" ? new Version(options.typeScriptVersion) : (_a2 = options.typeScriptVersion) != null ? _a2 : getTypeScriptVersion();
1847
- const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter;
1848
- const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter;
1849
- const since = typeof options.since === "string" ? new Version(options.since) : (_b = options.since) != null ? _b : warnAfter;
1850
- const error = options.error || errorAfter && version2.compareTo(errorAfter) <= 0;
1851
- const warn = !warnAfter || version2.compareTo(warnAfter) >= 0;
1852
- return error ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop;
1853
- }
1854
- Debug2.createDeprecation = createDeprecation;
1855
- function wrapFunction(deprecation, func) {
1856
- return function() {
1857
- deprecation();
1858
- return func.apply(this, arguments);
1859
- };
1860
- }
1861
- function deprecate(func, options) {
1862
- var _a2;
1863
- const deprecation = createDeprecation((_a2 = options == null ? void 0 : options.name) != null ? _a2 : getFunctionName(func), options);
1864
- return wrapFunction(deprecation, func);
1865
- }
1866
- Debug2.deprecate = deprecate;
1867
1815
  function formatVariance(varianceFlags) {
1868
1816
  const variance = varianceFlags & 7 /* VarianceMask */;
1869
1817
  let result = variance === 0 /* Invariant */ ? "in out" : variance === 3 /* Bivariant */ ? "[bivariant]" : variance === 2 /* Contravariant */ ? "in" : variance === 1 /* Covariant */ ? "out" : variance === 4 /* Independent */ ? "[independent]" : "";
@@ -3712,6 +3660,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
3712
3660
  return TypeFlags2;
3713
3661
  })(TypeFlags || {});
3714
3662
  var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
3663
+ ObjectFlags3[ObjectFlags3["None"] = 0] = "None";
3715
3664
  ObjectFlags3[ObjectFlags3["Class"] = 1] = "Class";
3716
3665
  ObjectFlags3[ObjectFlags3["Interface"] = 2] = "Interface";
3717
3666
  ObjectFlags3[ObjectFlags3["Reference"] = 4] = "Reference";
@@ -6776,10 +6725,10 @@ var Diagnostics = {
6776
6725
  Module_name_0_matched_pattern_1: diag(6092, 3 /* Message */, "Module_name_0_matched_pattern_1_6092", "Module name '{0}', matched pattern '{1}'."),
6777
6726
  Trying_substitution_0_candidate_module_location_Colon_1: diag(6093, 3 /* Message */, "Trying_substitution_0_candidate_module_location_Colon_1_6093", "Trying substitution '{0}', candidate module location: '{1}'."),
6778
6727
  Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
6779
- Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", "Loading module as file / folder, candidate module location '{0}', target file type '{1}'."),
6728
+ Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
6780
6729
  File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
6781
6730
  File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."),
6782
- Loading_module_0_from_node_modules_folder_target_file_type_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", "Loading module '{0}' from 'node_modules' folder, target file type '{1}'."),
6731
+ Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
6783
6732
  Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
6784
6733
  package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
6785
6734
  package_json_has_0_field_1_that_references_2: diag(6101, 3 /* Message */, "package_json_has_0_field_1_that_references_2_6101", "'package.json' has '{0}' field '{1}' that references '{2}'."),
@@ -15134,6 +15083,7 @@ var supportedJSExtensionsFlat = flatten(supportedJSExtensions);
15134
15083
  var allSupportedExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */, ".js" /* Js */, ".jsx" /* Jsx */], [".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */], [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */]];
15135
15084
  var allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]];
15136
15085
  var supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */];
15086
+ var supportedTSImplementationExtensions = [".ts" /* Ts */, ".cts" /* Cts */, ".mts" /* Mts */, ".tsx" /* Tsx */];
15137
15087
  function getSupportedExtensions(options, extraFileExtensions) {
15138
15088
  const needJsExtensions = options && getAllowJSCompilerOption(options);
15139
15089
  if (!extraFileExtensions || extraFileExtensions.length === 0) {
@@ -15356,6 +15306,26 @@ function parsePseudoBigInt(stringValue) {
15356
15306
  function pseudoBigIntToString({ negative, base10Value }) {
15357
15307
  return (negative && base10Value !== "0" ? "-" : "") + base10Value;
15358
15308
  }
15309
+ function parseValidBigInt(text) {
15310
+ const negative = text.startsWith("-");
15311
+ const base10Value = parsePseudoBigInt(`${negative ? text.slice(1) : text}n`);
15312
+ return { negative, base10Value };
15313
+ }
15314
+ function isValidBigIntString(s, roundTripOnly) {
15315
+ if (s === "")
15316
+ return false;
15317
+ const scanner = createScanner(99 /* ESNext */, false);
15318
+ let success = true;
15319
+ scanner.setOnError(() => success = false);
15320
+ scanner.setText(s + "n");
15321
+ let result = scanner.scan();
15322
+ const negative = result === 40 /* MinusToken */;
15323
+ if (negative) {
15324
+ result = scanner.scan();
15325
+ }
15326
+ const flags = scanner.getTokenFlags();
15327
+ return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === s.length + 1 && !(flags & 512 /* ContainsSeparator */) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner.getTokenValue()) }));
15328
+ }
15359
15329
  function isValidTypeOnlyAliasUseSite(useSite) {
15360
15330
  return !!(useSite.flags & 16777216 /* Ambient */) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
15361
15331
  }
@@ -15675,6 +15645,10 @@ function isOptionalJSDocPropertyLikeTag(node) {
15675
15645
  const { isBracketed, typeExpression } = node;
15676
15646
  return isBracketed || !!typeExpression && typeExpression.type.kind === 319 /* JSDocOptionalType */;
15677
15647
  }
15648
+ function canUsePropertyAccess(name, languageVersion) {
15649
+ const firstChar = name.charCodeAt(0);
15650
+ return firstChar === 35 /* hash */ ? name.length > 1 && isIdentifierStart(name.charCodeAt(1), languageVersion) : isIdentifierStart(firstChar, languageVersion);
15651
+ }
15678
15652
 
15679
15653
  // src/compiler/factory/baseNodeFactory.ts
15680
15654
  function createBaseNodeFactory() {
@@ -21121,7 +21095,7 @@ var asyncDelegator = {
21121
21095
  var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
21122
21096
  var i, p;
21123
21097
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
21124
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
21098
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
21125
21099
  };`
21126
21100
  };
21127
21101
  var asyncValues = {
@@ -32722,15 +32696,18 @@ function removeIgnoredPackageId(r) {
32722
32696
  return { path: r.path, ext: r.extension };
32723
32697
  }
32724
32698
  }
32725
- var Extensions = /* @__PURE__ */ ((Extensions2) => {
32726
- Extensions2[Extensions2["TypeScript"] = 0] = "TypeScript";
32727
- Extensions2[Extensions2["JavaScript"] = 1] = "JavaScript";
32728
- Extensions2[Extensions2["Json"] = 2] = "Json";
32729
- Extensions2[Extensions2["TSConfig"] = 3] = "TSConfig";
32730
- Extensions2[Extensions2["DtsOnly"] = 4] = "DtsOnly";
32731
- Extensions2[Extensions2["TsOnly"] = 5] = "TsOnly";
32732
- return Extensions2;
32733
- })(Extensions || {});
32699
+ function formatExtensions(extensions) {
32700
+ const result = [];
32701
+ if (extensions & 1 /* TypeScript */)
32702
+ result.push("TypeScript");
32703
+ if (extensions & 2 /* JavaScript */)
32704
+ result.push("JavaScript");
32705
+ if (extensions & 4 /* Declaration */)
32706
+ result.push("Declaration");
32707
+ if (extensions & 8 /* Json */)
32708
+ result.push("JSON");
32709
+ return result.join(", ");
32710
+ }
32734
32711
  function resolvedTypeScriptOnly(resolved) {
32735
32712
  if (!resolved) {
32736
32713
  return void 0;
@@ -32934,7 +32911,8 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
32934
32911
  features,
32935
32912
  conditions,
32936
32913
  requestContainingDirectory: containingDirectory,
32937
- reportDiagnostic: (diag2) => void diagnostics.push(diag2)
32914
+ reportDiagnostic: (diag2) => void diagnostics.push(diag2),
32915
+ isConfigLookup: false
32938
32916
  };
32939
32917
  let resolved = primaryLookup();
32940
32918
  let primary = true;
@@ -32984,7 +32962,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
32984
32962
  }
32985
32963
  return resolvedTypeScriptOnly(
32986
32964
  loadNodeModuleFromDirectory(
32987
- 4 /* DtsOnly */,
32965
+ 4 /* Declaration */,
32988
32966
  candidate,
32989
32967
  !directoryExists,
32990
32968
  moduleResolutionState
@@ -33005,11 +32983,11 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
33005
32983
  }
33006
32984
  let result2;
33007
32985
  if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) {
33008
- const searchResult = loadModuleFromNearestNodeModulesDirectory(4 /* DtsOnly */, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, void 0, void 0);
32986
+ const searchResult = loadModuleFromNearestNodeModulesDirectory(4 /* Declaration */, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, void 0, void 0);
33009
32987
  result2 = searchResult && searchResult.value;
33010
32988
  } else {
33011
32989
  const { path: candidate } = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName);
33012
- result2 = nodeLoadModuleByRelativeName(4 /* DtsOnly */, candidate, false, moduleResolutionState, true);
32990
+ result2 = nodeLoadModuleByRelativeName(4 /* Declaration */, candidate, false, moduleResolutionState, true);
33013
32991
  }
33014
32992
  return resolvedTypeScriptOnly(result2);
33015
32993
  } else {
@@ -33525,38 +33503,42 @@ function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions,
33525
33503
  resolutionMode
33526
33504
  );
33527
33505
  }
33528
- var jsOnlyExtensions = [1 /* JavaScript */];
33529
- var tsExtensions = [0 /* TypeScript */, 1 /* JavaScript */];
33530
- var tsPlusJsonExtensions = [...tsExtensions, 2 /* Json */];
33531
- var tsconfigExtensions = [3 /* TSConfig */];
33532
33506
  function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
33533
33507
  const containingDirectory = getDirectoryPath(containingFile);
33534
33508
  const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
33535
- let extensions = compilerOptions.noDtsResolution ? [5 /* TsOnly */, 1 /* JavaScript */] : tsExtensions;
33509
+ let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
33536
33510
  if (compilerOptions.resolveJsonModule) {
33537
- extensions = [...extensions, 2 /* Json */];
33511
+ extensions |= 8 /* Json */;
33538
33512
  }
33539
- return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference);
33513
+ return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, false, redirectedReference);
33540
33514
  }
33541
33515
  function tryResolveJSModuleWorker(moduleName, initialDir, host) {
33542
- return nodeModuleNameResolverWorker(0 /* None */, moduleName, initialDir, { moduleResolution: 2 /* NodeJs */, allowJs: true }, host, void 0, jsOnlyExtensions, void 0);
33516
+ return nodeModuleNameResolverWorker(
33517
+ 0 /* None */,
33518
+ moduleName,
33519
+ initialDir,
33520
+ { moduleResolution: 2 /* NodeJs */, allowJs: true },
33521
+ host,
33522
+ void 0,
33523
+ 2 /* JavaScript */,
33524
+ false,
33525
+ void 0
33526
+ );
33543
33527
  }
33544
- function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, lookupConfig) {
33528
+ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
33545
33529
  let extensions;
33546
- if (lookupConfig) {
33547
- extensions = tsconfigExtensions;
33530
+ if (isConfigLookup) {
33531
+ extensions = 8 /* Json */;
33548
33532
  } else if (compilerOptions.noDtsResolution) {
33549
- extensions = [5 /* TsOnly */];
33550
- if (compilerOptions.allowJs)
33551
- extensions.push(1 /* JavaScript */);
33533
+ extensions = 3 /* ImplementationFiles */;
33552
33534
  if (compilerOptions.resolveJsonModule)
33553
- extensions.push(2 /* Json */);
33535
+ extensions |= 8 /* Json */;
33554
33536
  } else {
33555
- extensions = compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions;
33537
+ extensions = compilerOptions.resolveJsonModule ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
33556
33538
  }
33557
- return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, redirectedReference);
33539
+ return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
33558
33540
  }
33559
- function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
33541
+ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
33560
33542
  var _a2, _b;
33561
33543
  const traceEnabled = isTraceEnabled(compilerOptions, host);
33562
33544
  const failedLookupLocations = [];
@@ -33576,12 +33558,20 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
33576
33558
  features,
33577
33559
  conditions,
33578
33560
  requestContainingDirectory: containingDirectory,
33579
- reportDiagnostic: (diag2) => void diagnostics.push(diag2)
33561
+ reportDiagnostic: (diag2) => void diagnostics.push(diag2),
33562
+ isConfigLookup
33580
33563
  };
33581
33564
  if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
33582
33565
  trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
33583
33566
  }
33584
- const result = forEach(extensions, (ext) => tryResolve(ext));
33567
+ let result;
33568
+ if (getEmitModuleResolutionKind(compilerOptions) === 2 /* NodeJs */) {
33569
+ const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
33570
+ const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
33571
+ result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
33572
+ } else {
33573
+ result = tryResolve(extensions);
33574
+ }
33585
33575
  return createResolvedModuleWithFailedLookupLocations(
33586
33576
  (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved,
33587
33577
  (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport,
@@ -33606,7 +33596,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
33606
33596
  }
33607
33597
  if (!resolved2) {
33608
33598
  if (traceEnabled) {
33609
- trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions2]);
33599
+ trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
33610
33600
  }
33611
33601
  resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
33612
33602
  }
@@ -33647,7 +33637,7 @@ function realPath(path, host, traceEnabled) {
33647
33637
  }
33648
33638
  function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
33649
33639
  if (state.traceEnabled) {
33650
- trace(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]);
33640
+ trace(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1, candidate, formatExtensions(extensions));
33651
33641
  }
33652
33642
  if (!hasTrailingDirectorySeparator(candidate)) {
33653
33643
  if (!onlyRecordFailures) {
@@ -33705,10 +33695,9 @@ function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures
33705
33695
  return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
33706
33696
  }
33707
33697
  function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
33708
- if (extensions === 2 /* Json */ || extensions === 3 /* TSConfig */) {
33709
- const extensionLess = tryRemoveExtension(candidate, ".json" /* Json */);
33710
- const extension = extensionLess ? candidate.substring(extensionLess.length) : "";
33711
- return extensionLess === void 0 && extensions === 2 /* Json */ ? void 0 : tryAddingExtensions(extensionLess || candidate, extensions, extension, onlyRecordFailures, state);
33698
+ const resolvedByReplacingExtension = loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
33699
+ if (resolvedByReplacingExtension) {
33700
+ return resolvedByReplacingExtension;
33712
33701
  }
33713
33702
  if (!(state.features & 32 /* EsmMode */)) {
33714
33703
  const resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, "", onlyRecordFailures, state);
@@ -33716,10 +33705,9 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
33716
33705
  return resolvedByAddingExtension;
33717
33706
  }
33718
33707
  }
33719
- return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
33720
33708
  }
33721
33709
  function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
33722
- if (hasJSFileExtension(candidate) || fileExtensionIs(candidate, ".json" /* Json */) && state.compilerOptions.resolveJsonModule) {
33710
+ if (hasJSFileExtension(candidate) || extensions & 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
33723
33711
  const extensionless = removeFileExtension(candidate);
33724
33712
  const extension = candidate.substring(extensionless.length);
33725
33713
  if (state.traceEnabled) {
@@ -33729,7 +33717,7 @@ function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecor
33729
33717
  }
33730
33718
  }
33731
33719
  function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
33732
- if ((extensions === 0 /* TypeScript */ || extensions === 4 /* DtsOnly */) && fileExtensionIsOneOf(candidate, supportedTSExtensionsFlat)) {
33720
+ if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
33733
33721
  const result = tryFile(candidate, onlyRecordFailures, state);
33734
33722
  return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate) } : void 0;
33735
33723
  }
@@ -33742,59 +33730,32 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
33742
33730
  onlyRecordFailures = !directoryProbablyExists(directory, state.host);
33743
33731
  }
33744
33732
  }
33745
- switch (extensions) {
33746
- case 4 /* DtsOnly */:
33747
- switch (originalExtension) {
33748
- case ".mjs" /* Mjs */:
33749
- case ".mts" /* Mts */:
33750
- case ".d.mts" /* Dmts */:
33751
- return tryExtension(".d.mts" /* Dmts */);
33752
- case ".cjs" /* Cjs */:
33753
- case ".cts" /* Cts */:
33754
- case ".d.cts" /* Dcts */:
33755
- return tryExtension(".d.cts" /* Dcts */);
33756
- case ".json" /* Json */:
33757
- candidate += ".json" /* Json */;
33758
- return tryExtension(".d.ts" /* Dts */);
33759
- default:
33760
- return tryExtension(".d.ts" /* Dts */);
33761
- }
33762
- case 0 /* TypeScript */:
33763
- case 5 /* TsOnly */:
33764
- const useDts = extensions === 0 /* TypeScript */;
33765
- switch (originalExtension) {
33766
- case ".mjs" /* Mjs */:
33767
- case ".mts" /* Mts */:
33768
- case ".d.mts" /* Dmts */:
33769
- return tryExtension(".mts" /* Mts */) || (useDts ? tryExtension(".d.mts" /* Dmts */) : void 0);
33770
- case ".cjs" /* Cjs */:
33771
- case ".cts" /* Cts */:
33772
- case ".d.cts" /* Dcts */:
33773
- return tryExtension(".cts" /* Cts */) || (useDts ? tryExtension(".d.cts" /* Dcts */) : void 0);
33774
- case ".json" /* Json */:
33775
- candidate += ".json" /* Json */;
33776
- return useDts ? tryExtension(".d.ts" /* Dts */) : void 0;
33777
- default:
33778
- return tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */) || (useDts ? tryExtension(".d.ts" /* Dts */) : void 0);
33779
- }
33780
- case 1 /* JavaScript */:
33781
- switch (originalExtension) {
33782
- case ".mjs" /* Mjs */:
33783
- case ".mts" /* Mts */:
33784
- case ".d.mts" /* Dmts */:
33785
- return tryExtension(".mjs" /* Mjs */);
33786
- case ".cjs" /* Cjs */:
33787
- case ".cts" /* Cts */:
33788
- case ".d.cts" /* Dcts */:
33789
- return tryExtension(".cjs" /* Cjs */);
33790
- case ".json" /* Json */:
33791
- return tryExtension(".json" /* Json */);
33792
- default:
33793
- return tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */);
33733
+ switch (originalExtension) {
33734
+ case ".mjs" /* Mjs */:
33735
+ case ".mts" /* Mts */:
33736
+ case ".d.mts" /* Dmts */:
33737
+ return extensions & 1 /* TypeScript */ && tryExtension(".mts" /* Mts */) || extensions & 4 /* Declaration */ && tryExtension(".d.mts" /* Dmts */) || extensions & 2 /* JavaScript */ && tryExtension(".mjs" /* Mjs */) || void 0;
33738
+ case ".cjs" /* Cjs */:
33739
+ case ".cts" /* Cts */:
33740
+ case ".d.cts" /* Dcts */:
33741
+ return extensions & 1 /* TypeScript */ && tryExtension(".cts" /* Cts */) || extensions & 4 /* Declaration */ && tryExtension(".d.cts" /* Dcts */) || extensions & 2 /* JavaScript */ && tryExtension(".cjs" /* Cjs */) || void 0;
33742
+ case ".json" /* Json */:
33743
+ const originalCandidate = candidate;
33744
+ if (extensions & 4 /* Declaration */) {
33745
+ candidate += ".json" /* Json */;
33746
+ const result = tryExtension(".d.ts" /* Dts */);
33747
+ if (result)
33748
+ return result;
33794
33749
  }
33795
- case 3 /* TSConfig */:
33796
- case 2 /* Json */:
33797
- return tryExtension(".json" /* Json */);
33750
+ if (extensions & 8 /* Json */) {
33751
+ candidate = originalCandidate;
33752
+ const result = tryExtension(".json" /* Json */);
33753
+ if (result)
33754
+ return result;
33755
+ }
33756
+ return void 0;
33757
+ default:
33758
+ return extensions & 1 /* TypeScript */ && (tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */)) || extensions & 4 /* Declaration */ && tryExtension(".d.ts" /* Dts */) || extensions & 2 /* JavaScript */ && (tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */)) || state.isConfigLookup && tryExtension(".json" /* Json */) || void 0;
33798
33759
  }
33799
33760
  function tryExtension(ext) {
33800
33761
  const path = tryFile(candidate + ext, onlyRecordFailures, state);
@@ -33843,7 +33804,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
33843
33804
  features: 0 /* None */,
33844
33805
  conditions: emptyArray,
33845
33806
  requestContainingDirectory: void 0,
33846
- reportDiagnostic: noop
33807
+ reportDiagnostic: noop,
33808
+ isConfigLookup: false
33847
33809
  };
33848
33810
  }
33849
33811
  function getPackageScopeForPath(fileName, state) {
@@ -33902,23 +33864,10 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
33902
33864
  function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
33903
33865
  let packageFile;
33904
33866
  if (jsonContent) {
33905
- switch (extensions) {
33906
- case 1 /* JavaScript */:
33907
- case 2 /* Json */:
33908
- case 5 /* TsOnly */:
33909
- packageFile = readPackageJsonMainField(jsonContent, candidate, state);
33910
- break;
33911
- case 0 /* TypeScript */:
33912
- packageFile = readPackageJsonTypesFields(jsonContent, candidate, state) || readPackageJsonMainField(jsonContent, candidate, state);
33913
- break;
33914
- case 4 /* DtsOnly */:
33915
- packageFile = readPackageJsonTypesFields(jsonContent, candidate, state);
33916
- break;
33917
- case 3 /* TSConfig */:
33918
- packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
33919
- break;
33920
- default:
33921
- return Debug.assertNever(extensions);
33867
+ if (state.isConfigLookup) {
33868
+ packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
33869
+ } else {
33870
+ packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(jsonContent, candidate, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(jsonContent, candidate, state) || void 0;
33922
33871
  }
33923
33872
  }
33924
33873
  const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
@@ -33932,18 +33881,18 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
33932
33881
  trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
33933
33882
  }
33934
33883
  }
33935
- const nextExtensions = extensions2 === 4 /* DtsOnly */ ? 0 /* TypeScript */ : extensions2;
33884
+ const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
33936
33885
  const features = state2.features;
33937
33886
  if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
33938
33887
  state2.features &= ~32 /* EsmMode */;
33939
33888
  }
33940
- const result = nodeLoadModuleByRelativeName(nextExtensions, candidate2, onlyRecordFailures2, state2, false);
33889
+ const result = nodeLoadModuleByRelativeName(expandedExtensions, candidate2, onlyRecordFailures2, state2, false);
33941
33890
  state2.features = features;
33942
33891
  return result;
33943
33892
  };
33944
33893
  const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
33945
33894
  const onlyRecordFailuresForIndex = onlyRecordFailures || !directoryProbablyExists(candidate, state.host);
33946
- const indexPath = combinePaths(candidate, extensions === 3 /* TSConfig */ ? "tsconfig" : "index");
33895
+ const indexPath = combinePaths(candidate, state.isConfigLookup ? "tsconfig" : "index");
33947
33896
  if (versionPaths && (!packageFile || containsPath(candidate, packageFile))) {
33948
33897
  const moduleName = getRelativePathFromDirectory(candidate, packageFile || indexPath, false);
33949
33898
  if (state.traceEnabled) {
@@ -33966,19 +33915,7 @@ function resolvedIfExtensionMatches(extensions, path) {
33966
33915
  return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext } : void 0;
33967
33916
  }
33968
33917
  function extensionIsOk(extensions, extension) {
33969
- switch (extensions) {
33970
- case 1 /* JavaScript */:
33971
- return extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */;
33972
- case 3 /* TSConfig */:
33973
- case 2 /* Json */:
33974
- return extension === ".json" /* Json */;
33975
- case 0 /* TypeScript */:
33976
- return extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */ || extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */;
33977
- case 5 /* TsOnly */:
33978
- return extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */;
33979
- case 4 /* DtsOnly */:
33980
- return extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */;
33981
- }
33918
+ return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
33982
33919
  }
33983
33920
  function parsePackageName(moduleName) {
33984
33921
  let idx = moduleName.indexOf(directorySeparator);
@@ -34140,7 +34077,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
34140
34077
  const combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath;
34141
34078
  traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup);
34142
34079
  traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/");
34143
- const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, [extensions], redirectedReference);
34080
+ const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, extensions, false, redirectedReference);
34144
34081
  return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : void 0);
34145
34082
  }
34146
34083
  if (state.traceEnabled) {
@@ -34231,7 +34168,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
34231
34168
  }
34232
34169
  function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
34233
34170
  var _a2, _b, _c, _d;
34234
- if ((extensions === 0 /* TypeScript */ || extensions === 1 /* JavaScript */ || extensions === 2 /* Json */) && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
34171
+ if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
34235
34172
  const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
34236
34173
  const commonSourceDirGuesses = [];
34237
34174
  if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
@@ -34268,10 +34205,9 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
34268
34205
  if (fileExtensionIs(possibleInputBase, ext)) {
34269
34206
  const inputExts = getPossibleOriginalInputExtensionForExtension(possibleInputBase);
34270
34207
  for (const possibleExt of inputExts) {
34271
- const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
34272
- if (extensions === 0 /* TypeScript */ && hasJSFileExtension(possibleInputWithInputExtension) || extensions === 1 /* JavaScript */ && hasTSFileExtension(possibleInputWithInputExtension)) {
34208
+ if (!extensionIsOk(extensions, possibleExt))
34273
34209
  continue;
34274
- }
34210
+ const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
34275
34211
  if (state.host.fileExists(possibleInputWithInputExtension)) {
34276
34212
  return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state)));
34277
34213
  }
@@ -34312,19 +34248,31 @@ function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, direc
34312
34248
  return loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, false, cache, redirectedReference);
34313
34249
  }
34314
34250
  function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directory, state) {
34315
- return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* DtsOnly */, moduleName, directory, state, true, void 0, void 0);
34251
+ return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* Declaration */, moduleName, directory, state, true, void 0, void 0);
34316
34252
  }
34317
34253
  function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
34318
34254
  const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */, redirectedReference);
34319
- return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
34320
- if (getBaseFileName(ancestorDirectory) !== "node_modules") {
34321
- const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state);
34322
- if (resolutionFromCache) {
34323
- return resolutionFromCache;
34255
+ const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
34256
+ const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
34257
+ if (priorityExtensions) {
34258
+ const result = lookup(priorityExtensions);
34259
+ if (result)
34260
+ return result;
34261
+ }
34262
+ if (secondaryExtensions && !typesScopeOnly) {
34263
+ return lookup(secondaryExtensions);
34264
+ }
34265
+ function lookup(extensions2) {
34266
+ return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
34267
+ if (getBaseFileName(ancestorDirectory) !== "node_modules") {
34268
+ const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state);
34269
+ if (resolutionFromCache) {
34270
+ return resolutionFromCache;
34271
+ }
34272
+ return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
34324
34273
  }
34325
- return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
34326
- }
34327
- });
34274
+ });
34275
+ }
34328
34276
  }
34329
34277
  function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
34330
34278
  const nodeModulesFolder = combinePaths(directory, "node_modules");
@@ -34332,11 +34280,13 @@ function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, dir
34332
34280
  if (!nodeModulesFolderExists && state.traceEnabled) {
34333
34281
  trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder);
34334
34282
  }
34335
- const packageResult = typesScopeOnly ? void 0 : loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference);
34336
- if (packageResult) {
34337
- return packageResult;
34283
+ if (!typesScopeOnly) {
34284
+ const packageResult = loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference);
34285
+ if (packageResult) {
34286
+ return packageResult;
34287
+ }
34338
34288
  }
34339
- if (extensions === 0 /* TypeScript */ || extensions === 4 /* DtsOnly */) {
34289
+ if (extensions & 4 /* Declaration */) {
34340
34290
  const nodeModulesAtTypes2 = combinePaths(nodeModulesFolder, "@types");
34341
34291
  let nodeModulesAtTypesExists = nodeModulesFolderExists;
34342
34292
  if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes2, state.host)) {
@@ -34345,7 +34295,7 @@ function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, dir
34345
34295
  }
34346
34296
  nodeModulesAtTypesExists = false;
34347
34297
  }
34348
- return loadModuleFromSpecificNodeModulesDirectory(4 /* DtsOnly */, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes2, nodeModulesAtTypesExists, state, cache, redirectedReference);
34298
+ return loadModuleFromSpecificNodeModulesDirectory(4 /* Declaration */, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes2, nodeModulesAtTypesExists, state, cache, redirectedReference);
34349
34299
  }
34350
34300
  }
34351
34301
  function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
@@ -34486,9 +34436,10 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
34486
34436
  features: 0 /* None */,
34487
34437
  conditions: [],
34488
34438
  requestContainingDirectory: containingDirectory,
34489
- reportDiagnostic: (diag2) => void diagnostics.push(diag2)
34439
+ reportDiagnostic: (diag2) => void diagnostics.push(diag2),
34440
+ isConfigLookup: false
34490
34441
  };
34491
- const resolved = tryResolve(0 /* TypeScript */) || tryResolve(1 /* JavaScript */);
34442
+ const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
34492
34443
  return createResolvedModuleWithFailedLookupLocations(
34493
34444
  resolved && resolved.value,
34494
34445
  false,
@@ -34515,7 +34466,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
34515
34466
  if (resolved2) {
34516
34467
  return resolved2;
34517
34468
  }
34518
- if (extensions === 0 /* TypeScript */) {
34469
+ if (extensions & (1 /* TypeScript */ | 4 /* Declaration */)) {
34519
34470
  return loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, containingDirectory, state);
34520
34471
  }
34521
34472
  } else {
@@ -34542,9 +34493,10 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
34542
34493
  features: 0 /* None */,
34543
34494
  conditions: [],
34544
34495
  requestContainingDirectory: void 0,
34545
- reportDiagnostic: (diag2) => void diagnostics.push(diag2)
34496
+ reportDiagnostic: (diag2) => void diagnostics.push(diag2),
34497
+ isConfigLookup: false
34546
34498
  };
34547
- const resolved = loadModuleFromImmediateNodeModulesDirectory(4 /* DtsOnly */, moduleName, globalCache, state, false, void 0, void 0);
34499
+ const resolved = loadModuleFromImmediateNodeModulesDirectory(4 /* Declaration */, moduleName, globalCache, state, false, void 0, void 0);
34548
34500
  return createResolvedModuleWithFailedLookupLocations(
34549
34501
  resolved,
34550
34502
  true,
@@ -37494,6 +37446,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
37494
37446
  const importedFileIsInNodeModules = some(modulePaths, (p) => p.isInNodeModules);
37495
37447
  let nodeModulesSpecifiers;
37496
37448
  let pathsSpecifiers;
37449
+ let redirectPathsSpecifiers;
37497
37450
  let relativeSpecifiers;
37498
37451
  for (const modulePath of modulePaths) {
37499
37452
  const specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, void 0, options.overrideImportMode);
@@ -37502,34 +37455,53 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
37502
37455
  return nodeModulesSpecifiers;
37503
37456
  }
37504
37457
  if (!specifier) {
37505
- const local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences);
37506
- if (pathIsBareSpecifier(local)) {
37458
+ const local = getLocalModuleSpecifier(
37459
+ modulePath.path,
37460
+ info,
37461
+ compilerOptions,
37462
+ host,
37463
+ options.overrideImportMode || importingSourceFile.impliedNodeFormat,
37464
+ preferences,
37465
+ modulePath.isRedirect
37466
+ );
37467
+ if (!local) {
37468
+ continue;
37469
+ }
37470
+ if (modulePath.isRedirect) {
37471
+ redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
37472
+ } else if (pathIsBareSpecifier(local)) {
37507
37473
  pathsSpecifiers = append(pathsSpecifiers, local);
37508
- } else if (!modulePath.isRedirect && (!importedFileIsInNodeModules || modulePath.isInNodeModules)) {
37474
+ } else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) {
37509
37475
  relativeSpecifiers = append(relativeSpecifiers, local);
37510
37476
  }
37511
37477
  }
37512
37478
  }
37513
- return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : Debug.checkDefined(relativeSpecifiers);
37479
+ return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? redirectPathsSpecifiers : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : Debug.checkDefined(relativeSpecifiers);
37514
37480
  }
37515
37481
  function getInfo(importingSourceFileName, host) {
37516
37482
  const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true);
37517
37483
  const sourceDirectory = getDirectoryPath(importingSourceFileName);
37518
37484
  return { getCanonicalFileName, importingSourceFileName, sourceDirectory };
37519
37485
  }
37520
- function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, { ending, relativePreference }) {
37486
+ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, { ending, relativePreference }, pathsOnly) {
37521
37487
  const { baseUrl, paths, rootDirs } = compilerOptions;
37488
+ if (pathsOnly && !paths) {
37489
+ return void 0;
37490
+ }
37522
37491
  const { sourceDirectory, getCanonicalFileName } = info;
37523
37492
  const relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions);
37524
37493
  if (!baseUrl && !paths || relativePreference === 0 /* Relative */) {
37525
- return relativePath;
37494
+ return pathsOnly ? void 0 : relativePath;
37526
37495
  }
37527
37496
  const baseDirectory = getNormalizedAbsolutePath(getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory());
37528
37497
  const relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName);
37529
37498
  if (!relativeToBaseUrl) {
37530
- return relativePath;
37499
+ return pathsOnly ? void 0 : relativePath;
37531
37500
  }
37532
37501
  const fromPaths = paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, getAllowedEndings(ending, compilerOptions, importMode), host, compilerOptions);
37502
+ if (pathsOnly) {
37503
+ return fromPaths;
37504
+ }
37533
37505
  const maybeNonRelative = fromPaths === void 0 && baseUrl !== void 0 ? removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions) : fromPaths;
37534
37506
  if (!maybeNonRelative) {
37535
37507
  return relativePath;
@@ -38113,6 +38085,7 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
38113
38085
  return CheckMode3;
38114
38086
  })(CheckMode || {});
38115
38087
  var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
38088
+ SignatureCheckMode3[SignatureCheckMode3["None"] = 0] = "None";
38116
38089
  SignatureCheckMode3[SignatureCheckMode3["BivariantCallback"] = 1] = "BivariantCallback";
38117
38090
  SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
38118
38091
  SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
@@ -38130,7 +38103,7 @@ var intrinsicTypeKinds = new Map(getEntries({
38130
38103
  function SymbolLinks() {
38131
38104
  }
38132
38105
  function NodeLinks() {
38133
- this.flags = 0;
38106
+ this.flags = 0 /* None */;
38134
38107
  }
38135
38108
  function getNodeId(node) {
38136
38109
  if (!node.id) {
@@ -38975,7 +38948,7 @@ function createTypeChecker(host) {
38975
38948
  function createSymbol(flags, name, checkFlags) {
38976
38949
  symbolCount++;
38977
38950
  const symbol = new Symbol12(flags | 33554432 /* Transient */, name);
38978
- symbol.checkFlags = checkFlags || 0;
38951
+ symbol.checkFlags = checkFlags || 0 /* None */;
38979
38952
  return symbol;
38980
38953
  }
38981
38954
  function getExcludedSymbolFlags(flags) {
@@ -41286,7 +41259,7 @@ function createTypeChecker(host) {
41286
41259
  function createOriginType(flags) {
41287
41260
  return new Type7(checker, flags);
41288
41261
  }
41289
- function createIntrinsicType(kind, intrinsicName, objectFlags = 0) {
41262
+ function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */) {
41290
41263
  const type = createType(kind);
41291
41264
  type.intrinsicName = intrinsicName;
41292
41265
  type.objectFlags = objectFlags;
@@ -41781,25 +41754,22 @@ function createTypeChecker(host) {
41781
41754
  const context = {
41782
41755
  enclosingDeclaration,
41783
41756
  flags: flags || 0 /* None */,
41784
- tracker: tracker && tracker.trackSymbol ? tracker : {
41785
- trackSymbol: () => false,
41786
- moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? {
41787
- getCommonSourceDirectory: !!host.getCommonSourceDirectory ? () => host.getCommonSourceDirectory() : () => "",
41788
- getCurrentDirectory: () => host.getCurrentDirectory(),
41789
- getSymlinkCache: maybeBind(host, host.getSymlinkCache),
41790
- getPackageJsonInfoCache: () => {
41791
- var _a3;
41792
- return (_a3 = host.getPackageJsonInfoCache) == null ? void 0 : _a3.call(host);
41793
- },
41794
- useCaseSensitiveFileNames: maybeBind(host, host.useCaseSensitiveFileNames),
41795
- redirectTargetsMap: host.redirectTargetsMap,
41796
- getProjectReferenceRedirect: (fileName) => host.getProjectReferenceRedirect(fileName),
41797
- isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
41798
- fileExists: (fileName) => host.fileExists(fileName),
41799
- getFileIncludeReasons: () => host.getFileIncludeReasons(),
41800
- readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
41801
- } : void 0
41802
- },
41757
+ tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: () => false, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? {
41758
+ getCommonSourceDirectory: !!host.getCommonSourceDirectory ? () => host.getCommonSourceDirectory() : () => "",
41759
+ getCurrentDirectory: () => host.getCurrentDirectory(),
41760
+ getSymlinkCache: maybeBind(host, host.getSymlinkCache),
41761
+ getPackageJsonInfoCache: () => {
41762
+ var _a3;
41763
+ return (_a3 = host.getPackageJsonInfoCache) == null ? void 0 : _a3.call(host);
41764
+ },
41765
+ useCaseSensitiveFileNames: maybeBind(host, host.useCaseSensitiveFileNames),
41766
+ redirectTargetsMap: host.redirectTargetsMap,
41767
+ getProjectReferenceRedirect: (fileName) => host.getProjectReferenceRedirect(fileName),
41768
+ isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
41769
+ fileExists: (fileName) => host.fileExists(fileName),
41770
+ getFileIncludeReasons: () => host.getFileIncludeReasons(),
41771
+ readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
41772
+ } : void 0 },
41803
41773
  encounteredError: false,
41804
41774
  reportedDiagnostic: false,
41805
41775
  visitedTypes: void 0,
@@ -43156,8 +43126,7 @@ function createTypeChecker(host) {
43156
43126
  if (isSingleOrDoubleQuote(firstChar) && some(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
43157
43127
  return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context));
43158
43128
  }
43159
- const canUsePropertyAccess = firstChar === 35 /* hash */ ? symbolName2.length > 1 && isIdentifierStart(symbolName2.charCodeAt(1), languageVersion) : isIdentifierStart(firstChar, languageVersion);
43160
- if (index === 0 || canUsePropertyAccess) {
43129
+ if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) {
43161
43130
  const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 16777216 /* NoAsciiEscaping */);
43162
43131
  identifier.symbol = symbol2;
43163
43132
  return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier;
@@ -48130,7 +48099,7 @@ function createTypeChecker(host) {
48130
48099
  function containsArgumentsReference(declaration) {
48131
48100
  const links = getNodeLinks(declaration);
48132
48101
  if (links.containsArgumentsReference === void 0) {
48133
- if (links.flags & 8192 /* CaptureArguments */) {
48102
+ if (links.flags & 512 /* CaptureArguments */) {
48134
48103
  links.containsArgumentsReference = true;
48135
48104
  } else {
48136
48105
  links.containsArgumentsReference = traverse(declaration.body);
@@ -52030,7 +51999,7 @@ function createTypeChecker(host) {
52030
51999
  return compareSignaturesRelated(
52031
52000
  source,
52032
52001
  target,
52033
- ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0,
52002
+ ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0 /* None */,
52034
52003
  false,
52035
52004
  void 0,
52036
52005
  void 0,
@@ -52264,7 +52233,9 @@ function createTypeChecker(host) {
52264
52233
  if (relation === assignableRelation || relation === comparableRelation) {
52265
52234
  if (s & 1 /* Any */)
52266
52235
  return true;
52267
- if (s & (8 /* Number */ | 256 /* NumberLiteral */) && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || relation === assignableRelation && t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */))
52236
+ if (s & 8 /* Number */ && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */))
52237
+ return true;
52238
+ if (s & 256 /* NumberLiteral */ && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */ && source.value === target.value))
52268
52239
  return true;
52269
52240
  if (isUnknownLikeUnionType(target))
52270
52241
  return true;
@@ -55213,24 +55184,7 @@ function createTypeChecker(host) {
55213
55184
  return isFinite(n) && (!roundTripOnly || "" + n === s);
55214
55185
  }
55215
55186
  function parseBigIntLiteralType(text) {
55216
- const negative = text.startsWith("-");
55217
- const base10Value = parsePseudoBigInt(`${negative ? text.slice(1) : text}n`);
55218
- return getBigIntLiteralType({ negative, base10Value });
55219
- }
55220
- function isValidBigIntString(s, roundTripOnly) {
55221
- if (s === "")
55222
- return false;
55223
- const scanner = createScanner(99 /* ESNext */, false);
55224
- let success = true;
55225
- scanner.setOnError(() => success = false);
55226
- scanner.setText(s + "n");
55227
- let result = scanner.scan();
55228
- const negative = result === 40 /* MinusToken */;
55229
- if (negative) {
55230
- result = scanner.scan();
55231
- }
55232
- const flags = scanner.getTokenFlags();
55233
- return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === s.length + 1 && !(flags & 512 /* ContainsSeparator */) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner.getTokenValue()) }));
55187
+ return getBigIntLiteralType(parseValidBigInt(text));
55234
55188
  }
55235
55189
  function isMemberOfStringMapping(source, target) {
55236
55190
  if (target.flags & (4 /* String */ | 1 /* Any */)) {
@@ -55327,7 +55281,7 @@ function createTypeChecker(host) {
55327
55281
  pos = p;
55328
55282
  }
55329
55283
  }
55330
- function inferTypes(inferences, originalSource, originalTarget, priority = 0, contravariant = false) {
55284
+ function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
55331
55285
  let bivariant = false;
55332
55286
  let propagationType;
55333
55287
  let inferencePriority = 2048 /* MaxValue */;
@@ -57769,8 +57723,8 @@ function createTypeChecker(host) {
57769
57723
  }
57770
57724
  const parent = getRootDeclaration(symbol.valueDeclaration).parent;
57771
57725
  const links = getNodeLinks(parent);
57772
- if (!(links.flags & 8388608 /* AssignmentsMarked */)) {
57773
- links.flags |= 8388608 /* AssignmentsMarked */;
57726
+ if (!(links.flags & 524288 /* AssignmentsMarked */)) {
57727
+ links.flags |= 524288 /* AssignmentsMarked */;
57774
57728
  if (!hasParentWithAssignmentsMarked(parent)) {
57775
57729
  markNodeAssignments(parent);
57776
57730
  }
@@ -57778,7 +57732,7 @@ function createTypeChecker(host) {
57778
57732
  return symbol.isAssigned || false;
57779
57733
  }
57780
57734
  function hasParentWithAssignmentsMarked(node) {
57781
- return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 8388608 /* AssignmentsMarked */));
57735
+ return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 524288 /* AssignmentsMarked */));
57782
57736
  }
57783
57737
  function markNodeAssignments(node) {
57784
57738
  if (node.kind === 79 /* Identifier */) {
@@ -57857,11 +57811,11 @@ function createTypeChecker(host) {
57857
57811
  const parent = declaration.parent.parent;
57858
57812
  if (parent.kind === 257 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 166 /* Parameter */) {
57859
57813
  const links = getNodeLinks(parent);
57860
- if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
57861
- links.flags |= 268435456 /* InCheckIdentifier */;
57814
+ if (!(links.flags & 16777216 /* InCheckIdentifier */)) {
57815
+ links.flags |= 16777216 /* InCheckIdentifier */;
57862
57816
  const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
57863
57817
  const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
57864
- links.flags &= ~268435456 /* InCheckIdentifier */;
57818
+ links.flags &= ~16777216 /* InCheckIdentifier */;
57865
57819
  if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent.kind === 166 /* Parameter */ && isSymbolAssigned(symbol))) {
57866
57820
  const pattern = declaration.parent;
57867
57821
  const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, void 0, location.flowNode);
@@ -57911,7 +57865,7 @@ function createTypeChecker(host) {
57911
57865
  error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
57912
57866
  }
57913
57867
  }
57914
- getNodeLinks(container).flags |= 8192 /* CaptureArguments */;
57868
+ getNodeLinks(container).flags |= 512 /* CaptureArguments */;
57915
57869
  return getTypeOfSymbol(symbol);
57916
57870
  }
57917
57871
  if (shouldMarkIdentifierAliasReferenced(node)) {
@@ -57928,8 +57882,8 @@ function createTypeChecker(host) {
57928
57882
  let container = getContainingClass(node);
57929
57883
  while (container !== void 0) {
57930
57884
  if (container === declaration && container.name !== node) {
57931
- getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;
57932
- getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */;
57885
+ getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
57886
+ getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
57933
57887
  break;
57934
57888
  }
57935
57889
  container = getContainingClass(container);
@@ -57939,8 +57893,8 @@ function createTypeChecker(host) {
57939
57893
  while (container.kind !== 308 /* SourceFile */) {
57940
57894
  if (container.parent === declaration) {
57941
57895
  if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
57942
- getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;
57943
- getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */;
57896
+ getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
57897
+ getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
57944
57898
  }
57945
57899
  break;
57946
57900
  }
@@ -58054,7 +58008,7 @@ function createTypeChecker(host) {
58054
58008
  const part = getPartOfForStatementContainingNode(node.parent, container);
58055
58009
  if (part) {
58056
58010
  const links = getNodeLinks(part);
58057
- links.flags |= 131072 /* ContainsCapturedBlockScopeBinding */;
58011
+ links.flags |= 8192 /* ContainsCapturedBlockScopeBinding */;
58058
58012
  const capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []);
58059
58013
  pushIfUnique(capturedBindings, symbol);
58060
58014
  if (part === container.initializer) {
@@ -58064,19 +58018,19 @@ function createTypeChecker(host) {
58064
58018
  }
58065
58019
  }
58066
58020
  if (capturesBlockScopeBindingInLoopBody) {
58067
- getNodeLinks(enclosingIterationStatement).flags |= 65536 /* LoopWithCapturedBlockScopedBinding */;
58021
+ getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
58068
58022
  }
58069
58023
  }
58070
58024
  if (isForStatement(container)) {
58071
58025
  const varDeclList = getAncestor(symbol.valueDeclaration, 258 /* VariableDeclarationList */);
58072
58026
  if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
58073
- getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */;
58027
+ getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* NeedsLoopOutParameter */;
58074
58028
  }
58075
58029
  }
58076
- getNodeLinks(symbol.valueDeclaration).flags |= 524288 /* BlockScopedBindingInLoop */;
58030
+ getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
58077
58031
  }
58078
58032
  if (isCaptured) {
58079
- getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* CapturedBlockScopedBinding */;
58033
+ getNodeLinks(symbol.valueDeclaration).flags |= 16384 /* CapturedBlockScopedBinding */;
58080
58034
  }
58081
58035
  }
58082
58036
  function isBindingCapturedByNode(node, decl) {
@@ -58293,23 +58247,23 @@ function createTypeChecker(host) {
58293
58247
  checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
58294
58248
  }
58295
58249
  if (isStatic(container) || isCallExpression2) {
58296
- nodeCheckFlag = 512 /* SuperStatic */;
58250
+ nodeCheckFlag = 32 /* SuperStatic */;
58297
58251
  if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
58298
58252
  forEachEnclosingBlockScopeContainer(node.parent, (current) => {
58299
58253
  if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
58300
- getNodeLinks(current).flags |= 134217728 /* ContainsSuperPropertyInStaticInitializer */;
58254
+ getNodeLinks(current).flags |= 8388608 /* ContainsSuperPropertyInStaticInitializer */;
58301
58255
  }
58302
58256
  });
58303
58257
  }
58304
58258
  } else {
58305
- nodeCheckFlag = 256 /* SuperInstance */;
58259
+ nodeCheckFlag = 16 /* SuperInstance */;
58306
58260
  }
58307
58261
  getNodeLinks(node).flags |= nodeCheckFlag;
58308
58262
  if (container.kind === 171 /* MethodDeclaration */ && inAsyncFunction) {
58309
58263
  if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) {
58310
- getNodeLinks(container).flags |= 4096 /* MethodWithSuperPropertyAssignmentInAsync */;
58264
+ getNodeLinks(container).flags |= 256 /* MethodWithSuperPropertyAssignmentInAsync */;
58311
58265
  } else {
58312
- getNodeLinks(container).flags |= 2048 /* MethodWithSuperPropertyAccessInAsync */;
58266
+ getNodeLinks(container).flags |= 128 /* MethodWithSuperPropertyAccessInAsync */;
58313
58267
  }
58314
58268
  }
58315
58269
  if (needToCaptureLexicalThis) {
@@ -58337,7 +58291,7 @@ function createTypeChecker(host) {
58337
58291
  error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
58338
58292
  return errorType;
58339
58293
  }
58340
- return nodeCheckFlag === 512 /* SuperStatic */ ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType);
58294
+ return nodeCheckFlag === 32 /* SuperStatic */ ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType);
58341
58295
  function isLegalUsageOfSuperExpression(container2) {
58342
58296
  if (!container2) {
58343
58297
  return false;
@@ -59352,9 +59306,9 @@ function createTypeChecker(host) {
59352
59306
  const container = getEnclosingBlockScopeContainer(node.parent.parent);
59353
59307
  const enclosingIterationStatement = getEnclosingIterationStatement(container);
59354
59308
  if (enclosingIterationStatement) {
59355
- getNodeLinks(enclosingIterationStatement).flags |= 65536 /* LoopWithCapturedBlockScopedBinding */;
59356
- getNodeLinks(node).flags |= 524288 /* BlockScopedBindingInLoop */;
59357
- getNodeLinks(node.parent.parent).flags |= 524288 /* BlockScopedBindingInLoop */;
59309
+ getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
59310
+ getNodeLinks(node).flags |= 32768 /* BlockScopedBindingInLoop */;
59311
+ getNodeLinks(node.parent.parent).flags |= 32768 /* BlockScopedBindingInLoop */;
59358
59312
  }
59359
59313
  }
59360
59314
  if (links.resolvedType.flags & 98304 /* Nullable */ || !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
@@ -63341,10 +63295,10 @@ function createTypeChecker(host) {
63341
63295
  }
63342
63296
  function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
63343
63297
  const links = getNodeLinks(node);
63344
- if (!(links.flags & 1024 /* ContextChecked */)) {
63298
+ if (!(links.flags & 64 /* ContextChecked */)) {
63345
63299
  const contextualSignature = getContextualSignature(node);
63346
- if (!(links.flags & 1024 /* ContextChecked */)) {
63347
- links.flags |= 1024 /* ContextChecked */;
63300
+ if (!(links.flags & 64 /* ContextChecked */)) {
63301
+ links.flags |= 64 /* ContextChecked */;
63348
63302
  const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfNode(node)), 0 /* Call */));
63349
63303
  if (!signature) {
63350
63304
  return;
@@ -65334,13 +65288,13 @@ function createTypeChecker(host) {
65334
65288
  function setNodeLinksForPrivateIdentifierScope(node) {
65335
65289
  if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
65336
65290
  for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
65337
- getNodeLinks(lexicalScope).flags |= 67108864 /* ContainsClassWithPrivateIdentifiers */;
65291
+ getNodeLinks(lexicalScope).flags |= 4194304 /* ContainsClassWithPrivateIdentifiers */;
65338
65292
  }
65339
65293
  if (isClassExpression(node.parent)) {
65340
65294
  const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
65341
65295
  if (enclosingIterationStatement) {
65342
- getNodeLinks(node.name).flags |= 524288 /* BlockScopedBindingInLoop */;
65343
- getNodeLinks(enclosingIterationStatement).flags |= 65536 /* LoopWithCapturedBlockScopedBinding */;
65296
+ getNodeLinks(node.name).flags |= 32768 /* BlockScopedBindingInLoop */;
65297
+ getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
65344
65298
  }
65345
65299
  }
65346
65300
  }
@@ -66935,7 +66889,7 @@ function createTypeChecker(host) {
66935
66889
  }
66936
66890
  function checkWeakMapSetCollision(node) {
66937
66891
  const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
66938
- if (getNodeCheckFlags(enclosingBlockScope) & 67108864 /* ContainsClassWithPrivateIdentifiers */) {
66892
+ if (getNodeCheckFlags(enclosingBlockScope) & 4194304 /* ContainsClassWithPrivateIdentifiers */) {
66939
66893
  Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
66940
66894
  errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
66941
66895
  }
@@ -66949,18 +66903,18 @@ function createTypeChecker(host) {
66949
66903
  let hasCollision = false;
66950
66904
  if (isClassExpression(node)) {
66951
66905
  for (const member of node.members) {
66952
- if (getNodeCheckFlags(member) & 134217728 /* ContainsSuperPropertyInStaticInitializer */) {
66906
+ if (getNodeCheckFlags(member) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
66953
66907
  hasCollision = true;
66954
66908
  break;
66955
66909
  }
66956
66910
  }
66957
66911
  } else if (isFunctionExpression(node)) {
66958
- if (getNodeCheckFlags(node) & 134217728 /* ContainsSuperPropertyInStaticInitializer */) {
66912
+ if (getNodeCheckFlags(node) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
66959
66913
  hasCollision = true;
66960
66914
  }
66961
66915
  } else {
66962
66916
  const container = getEnclosingBlockScopeContainer(node);
66963
- if (container && getNodeCheckFlags(container) & 134217728 /* ContainsSuperPropertyInStaticInitializer */) {
66917
+ if (container && getNodeCheckFlags(container) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
66964
66918
  hasCollision = true;
66965
66919
  }
66966
66920
  }
@@ -68175,8 +68129,9 @@ function createTypeChecker(host) {
68175
68129
  });
68176
68130
  const containsArguments = containsArgumentsReference(node);
68177
68131
  if (containsArguments) {
68178
- const lastJSDocParam = lastOrUndefined(jsdocParameters);
68179
- if (isJs && lastJSDocParam && isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression && lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
68132
+ const lastJSDocParamIndex = jsdocParameters.length - 1;
68133
+ const lastJSDocParam = jsdocParameters[lastJSDocParamIndex];
68134
+ if (isJs && lastJSDocParam && isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression && lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !excludedParameters.has(lastJSDocParamIndex) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
68180
68135
  error(lastJSDocParam.name, Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, idText(lastJSDocParam.name));
68181
68136
  }
68182
68137
  } else {
@@ -68844,8 +68799,8 @@ function createTypeChecker(host) {
68844
68799
  }
68845
68800
  function computeEnumMemberValues(node) {
68846
68801
  const nodeLinks2 = getNodeLinks(node);
68847
- if (!(nodeLinks2.flags & 16384 /* EnumValuesComputed */)) {
68848
- nodeLinks2.flags |= 16384 /* EnumValuesComputed */;
68802
+ if (!(nodeLinks2.flags & 1024 /* EnumValuesComputed */)) {
68803
+ nodeLinks2.flags |= 1024 /* EnumValuesComputed */;
68849
68804
  let autoValue = 0;
68850
68805
  for (const member of node.members) {
68851
68806
  const value = computeMemberValue(member, autoValue);
@@ -69121,7 +69076,7 @@ function createTypeChecker(host) {
69121
69076
  }
69122
69077
  const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */);
69123
69078
  if (mergedClass && inSameLexicalScope(node, mergedClass)) {
69124
- getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */;
69079
+ getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */;
69125
69080
  }
69126
69081
  }
69127
69082
  if (isAmbientExternalModule) {
@@ -70752,8 +70707,8 @@ function createTypeChecker(host) {
70752
70707
  const nodeLinks2 = getNodeLinks(symbol.valueDeclaration);
70753
70708
  if (resolveName(container.parent, symbol.escapedName, 111551 /* Value */, void 0, void 0, false)) {
70754
70709
  links.isDeclarationWithCollidingName = true;
70755
- } else if (nodeLinks2.flags & 262144 /* CapturedBlockScopedBinding */) {
70756
- const isDeclaredInLoop = nodeLinks2.flags & 524288 /* BlockScopedBindingInLoop */;
70710
+ } else if (nodeLinks2.flags & 16384 /* CapturedBlockScopedBinding */) {
70711
+ const isDeclaredInLoop = nodeLinks2.flags & 32768 /* BlockScopedBindingInLoop */;
70757
70712
  const inLoopInitializer = isIterationStatement(container, false);
70758
70713
  const inLoopBodyBlock = container.kind === 238 /* Block */ && isIterationStatement(container.parent, false);
70759
70714
  links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock);
@@ -74189,10 +74144,10 @@ var visitEachChildTable = {
74189
74144
  nodeVisitor(node.initializer, visitor, isExpression)
74190
74145
  );
74191
74146
  },
74192
- [308 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
74147
+ [308 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
74193
74148
  return context.factory.updateSourceFile(
74194
74149
  node,
74195
- visitLexicalEnvironment(node.statements, visitor, context, void 0, void 0, nodesVisitor)
74150
+ visitLexicalEnvironment(node.statements, visitor, context)
74196
74151
  );
74197
74152
  },
74198
74153
  [353 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
@@ -77728,12 +77683,12 @@ function transformClassFields(context) {
77728
77683
  function visitClassExpressionInNewClassLexicalEnvironment(node, facts) {
77729
77684
  const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
77730
77685
  const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
77731
- const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 16777216 /* ClassWithConstructorReference */;
77686
+ const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */;
77732
77687
  let temp;
77733
77688
  function createClassTempVar() {
77734
77689
  const classCheckFlags = resolver.getNodeCheckFlags(node);
77735
- const isClassWithConstructorReference2 = classCheckFlags & 16777216 /* ClassWithConstructorReference */;
77736
- const requiresBlockScopedVar = classCheckFlags & 524288 /* BlockScopedBindingInLoop */;
77690
+ const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */;
77691
+ const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
77737
77692
  return factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2);
77738
77693
  }
77739
77694
  if (facts & 2 /* NeedsClassConstructorReference */) {
@@ -78246,7 +78201,7 @@ function transformClassFields(context) {
78246
78201
  }
78247
78202
  function trySubstituteClassAlias(node) {
78248
78203
  if (enabledSubstitutions & 1 /* ClassAliases */) {
78249
- if (resolver.getNodeCheckFlags(node) & 33554432 /* ConstructorReferenceInClass */) {
78204
+ if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
78250
78205
  const declaration = resolver.getReferencedValueDeclaration(node);
78251
78206
  if (declaration) {
78252
78207
  const classAlias = classAliases[declaration.id];
@@ -78269,7 +78224,7 @@ function transformClassFields(context) {
78269
78224
  const alreadyTransformed = isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left);
78270
78225
  if (!alreadyTransformed && !inlinable && shouldHoist) {
78271
78226
  const generatedName = factory2.getGeneratedNameForNode(name);
78272
- if (resolver.getNodeCheckFlags(name) & 524288 /* BlockScopedBindingInLoop */) {
78227
+ if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) {
78273
78228
  addBlockScopedVariable(generatedName);
78274
78229
  } else {
78275
78230
  hoistVariableDeclaration(generatedName);
@@ -78418,7 +78373,7 @@ function transformClassFields(context) {
78418
78373
  const { className } = getPrivateIdentifierEnvironment();
78419
78374
  const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_";
78420
78375
  const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable(void 0, true, prefix, suffix);
78421
- if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
78376
+ if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) {
78422
78377
  addBlockScopedVariable(identifier);
78423
78378
  } else {
78424
78379
  hoistVariableDeclaration(identifier);
@@ -79283,7 +79238,7 @@ function transformLegacyDecorators(context) {
79283
79238
  }
79284
79239
  }
79285
79240
  function getClassAliasIfNeeded(node) {
79286
- if (resolver.getNodeCheckFlags(node) & 16777216 /* ClassWithConstructorReference */) {
79241
+ if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) {
79287
79242
  enableSubstitutionForClassAliases();
79288
79243
  const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
79289
79244
  classAliases[getOriginalNodeId(node)] = classAlias;
@@ -79317,7 +79272,7 @@ function transformLegacyDecorators(context) {
79317
79272
  }
79318
79273
  function trySubstituteClassAlias(node) {
79319
79274
  if (classAliases) {
79320
- if (resolver.getNodeCheckFlags(node) & 33554432 /* ConstructorReferenceInClass */) {
79275
+ if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
79321
79276
  const declaration = resolver.getReferencedValueDeclaration(node);
79322
79277
  if (declaration) {
79323
79278
  const classAlias = classAliases[declaration.id];
@@ -79352,7 +79307,7 @@ function transformES2017(context) {
79352
79307
  let capturedSuperProperties;
79353
79308
  let hasSuperElementAccess;
79354
79309
  const substitutedSuperAccessors = [];
79355
- let contextFlags = 0;
79310
+ let contextFlags = 0 /* None */;
79356
79311
  const previousOnEmitNode = context.onEmitNode;
79357
79312
  const previousOnSubstituteNode = context.onSubstituteNode;
79358
79313
  context.onEmitNode = onEmitNode;
@@ -79679,7 +79634,7 @@ function transformES2017(context) {
79679
79634
  hasSuperElementAccess = false;
79680
79635
  let updated = visitFunctionBody(node.body, visitor, context);
79681
79636
  const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration);
79682
- const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* MethodWithSuperPropertyAccessInAsync */) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */;
79637
+ const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */;
79683
79638
  if (emitSuperHelpers) {
79684
79639
  enableSubstitutionForAsyncMethodsWithSuper();
79685
79640
  if (capturedSuperProperties.size) {
@@ -79690,9 +79645,9 @@ function transformES2017(context) {
79690
79645
  updated = factory2.updateBlock(updated, statements);
79691
79646
  }
79692
79647
  if (hasSuperElementAccess) {
79693
- if (resolver.getNodeCheckFlags(node) & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
79648
+ if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
79694
79649
  addEmitHelper(updated, advancedAsyncSuperHelper);
79695
- } else if (resolver.getNodeCheckFlags(node) & 2048 /* MethodWithSuperPropertyAccessInAsync */) {
79650
+ } else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
79696
79651
  addEmitHelper(updated, asyncSuperHelper);
79697
79652
  }
79698
79653
  }
@@ -79707,7 +79662,7 @@ function transformES2017(context) {
79707
79662
  const nodeType = original.type;
79708
79663
  const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
79709
79664
  const isArrowFunction2 = node.kind === 216 /* ArrowFunction */;
79710
- const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0;
79665
+ const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512 /* CaptureArguments */) !== 0;
79711
79666
  const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
79712
79667
  enclosingFunctionParameterNames = /* @__PURE__ */ new Set();
79713
79668
  for (const parameter of node.parameters) {
@@ -79734,7 +79689,7 @@ function transformES2017(context) {
79734
79689
  )
79735
79690
  );
79736
79691
  insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
79737
- const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* MethodWithSuperPropertyAccessInAsync */);
79692
+ const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
79738
79693
  if (emitSuperHelpers) {
79739
79694
  enableSubstitutionForAsyncMethodsWithSuper();
79740
79695
  if (capturedSuperProperties.size) {
@@ -79746,9 +79701,9 @@ function transformES2017(context) {
79746
79701
  const block = factory2.createBlock(statements, true);
79747
79702
  setTextRange(block, node.body);
79748
79703
  if (emitSuperHelpers && hasSuperElementAccess) {
79749
- if (resolver.getNodeCheckFlags(node) & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
79704
+ if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
79750
79705
  addEmitHelper(block, advancedAsyncSuperHelper);
79751
- } else if (resolver.getNodeCheckFlags(node) & 2048 /* MethodWithSuperPropertyAccessInAsync */) {
79706
+ } else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
79752
79707
  addEmitHelper(block, asyncSuperHelper);
79753
79708
  }
79754
79709
  }
@@ -79808,7 +79763,7 @@ function transformES2017(context) {
79808
79763
  }
79809
79764
  function onEmitNode(hint, node, emitCallback) {
79810
79765
  if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
79811
- const superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* MethodWithSuperPropertyAccessInAsync */ | 4096 /* MethodWithSuperPropertyAssignmentInAsync */);
79766
+ const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
79812
79767
  if (superContainerFlags !== enclosingSuperContainerFlags) {
79813
79768
  const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
79814
79769
  enclosingSuperContainerFlags = superContainerFlags;
@@ -79884,7 +79839,7 @@ function transformES2017(context) {
79884
79839
  return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
79885
79840
  }
79886
79841
  function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
79887
- if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
79842
+ if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
79888
79843
  return setTextRange(
79889
79844
  factory2.createPropertyAccessExpression(
79890
79845
  factory2.createCallExpression(
@@ -79909,7 +79864,7 @@ function transformES2017(context) {
79909
79864
  }
79910
79865
  }
79911
79866
  function createSuperAccessVariableStatement(factory2, resolver, node, names) {
79912
- const hasBinding = (resolver.getNodeCheckFlags(node) & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) !== 0;
79867
+ const hasBinding = (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) !== 0;
79913
79868
  const accessors = [];
79914
79869
  names.forEach((_, key) => {
79915
79870
  const name = unescapeLeadingUnderscores(key);
@@ -80847,7 +80802,7 @@ function transformES2018(context) {
80847
80802
  !!(hierarchyFacts & 1 /* HasLexicalThis */)
80848
80803
  )
80849
80804
  );
80850
- const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* MethodWithSuperPropertyAccessInAsync */);
80805
+ const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
80851
80806
  if (emitSuperHelpers) {
80852
80807
  enableSubstitutionForAsyncMethodsWithSuper();
80853
80808
  const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
@@ -80858,9 +80813,9 @@ function transformES2018(context) {
80858
80813
  insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
80859
80814
  const block = factory2.updateBlock(node.body, statements);
80860
80815
  if (emitSuperHelpers && hasSuperElementAccess) {
80861
- if (resolver.getNodeCheckFlags(node) & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
80816
+ if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
80862
80817
  addEmitHelper(block, advancedAsyncSuperHelper);
80863
- } else if (resolver.getNodeCheckFlags(node) & 2048 /* MethodWithSuperPropertyAccessInAsync */) {
80818
+ } else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
80864
80819
  addEmitHelper(block, asyncSuperHelper);
80865
80820
  }
80866
80821
  }
@@ -80970,7 +80925,7 @@ function transformES2018(context) {
80970
80925
  }
80971
80926
  function onEmitNode(hint, node, emitCallback) {
80972
80927
  if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
80973
- const superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* MethodWithSuperPropertyAccessInAsync */ | 4096 /* MethodWithSuperPropertyAssignmentInAsync */);
80928
+ const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
80974
80929
  if (superContainerFlags !== enclosingSuperContainerFlags) {
80975
80930
  const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
80976
80931
  enclosingSuperContainerFlags = superContainerFlags;
@@ -81046,7 +81001,7 @@ function transformES2018(context) {
81046
81001
  return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
81047
81002
  }
81048
81003
  function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
81049
- if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
81004
+ if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
81050
81005
  return setTextRange(
81051
81006
  factory2.createPropertyAccessExpression(
81052
81007
  factory2.createCallExpression(
@@ -83402,8 +83357,8 @@ function transformES2015(context) {
83402
83357
  }
83403
83358
  function shouldEmitExplicitInitializerForLetDeclaration(node) {
83404
83359
  const flags = resolver.getNodeCheckFlags(node);
83405
- const isCapturedInFunction = flags & 262144 /* CapturedBlockScopedBinding */;
83406
- const isDeclaredInLoop = flags & 524288 /* BlockScopedBindingInLoop */;
83360
+ const isCapturedInFunction = flags & 16384 /* CapturedBlockScopedBinding */;
83361
+ const isDeclaredInLoop = flags & 32768 /* BlockScopedBindingInLoop */;
83407
83362
  const emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0;
83408
83363
  const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0);
83409
83364
  return emitExplicitInitializer;
@@ -83764,7 +83719,7 @@ function transformES2015(context) {
83764
83719
  return factory2.inlineExpressions(expressions);
83765
83720
  }
83766
83721
  function shouldConvertPartOfIterationStatement(node) {
83767
- return (resolver.getNodeCheckFlags(node) & 131072 /* ContainsCapturedBlockScopeBinding */) !== 0;
83722
+ return (resolver.getNodeCheckFlags(node) & 8192 /* ContainsCapturedBlockScopeBinding */) !== 0;
83768
83723
  }
83769
83724
  function shouldConvertInitializerOfForStatement(node) {
83770
83725
  return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer);
@@ -83779,7 +83734,7 @@ function transformES2015(context) {
83779
83734
  return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node);
83780
83735
  }
83781
83736
  function shouldConvertBodyOfIterationStatement(node) {
83782
- return (resolver.getNodeCheckFlags(node) & 65536 /* LoopWithCapturedBlockScopedBinding */) !== 0;
83737
+ return (resolver.getNodeCheckFlags(node) & 4096 /* LoopWithCapturedBlockScopedBinding */) !== 0;
83783
83738
  }
83784
83739
  function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
83785
83740
  if (!state.hoistedLocalVariables) {
@@ -84240,10 +84195,10 @@ function transformES2015(context) {
84240
84195
  } else {
84241
84196
  loopParameters.push(factory2.createParameterDeclaration(void 0, void 0, name));
84242
84197
  const checkFlags = resolver.getNodeCheckFlags(decl);
84243
- if (checkFlags & 4194304 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
84198
+ if (checkFlags & 262144 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
84244
84199
  const outParamName = factory2.createUniqueName("out_" + idText(name));
84245
- let flags = 0;
84246
- if (checkFlags & 4194304 /* NeedsLoopOutParameter */) {
84200
+ let flags = 0 /* None */;
84201
+ if (checkFlags & 262144 /* NeedsLoopOutParameter */) {
84247
84202
  flags |= 1 /* Body */;
84248
84203
  }
84249
84204
  if (isForStatement(container)) {
@@ -92160,7 +92115,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
92160
92115
  const sourceMap = sourceMapGenerator.toString();
92161
92116
  writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, false, sourceFiles);
92162
92117
  if (printer.bundleFileInfo)
92163
- printer.bundleFileInfo.mapHash = computeSignature(sourceMap, maybeBind(host, host.createHash));
92118
+ printer.bundleFileInfo.mapHash = computeSignature(sourceMap, host);
92164
92119
  }
92165
92120
  } else {
92166
92121
  writer.writeLine();
@@ -92168,7 +92123,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
92168
92123
  const text = writer.getText();
92169
92124
  writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos, diagnostics: transform.diagnostics });
92170
92125
  if (printer.bundleFileInfo)
92171
- printer.bundleFileInfo.hash = computeSignature(text, maybeBind(host, host.createHash));
92126
+ printer.bundleFileInfo.hash = computeSignature(text, host);
92172
92127
  writer.clear();
92173
92128
  }
92174
92129
  function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
@@ -92314,7 +92269,6 @@ function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
92314
92269
  return result;
92315
92270
  }
92316
92271
  function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransformers) {
92317
- const createHash = maybeBind(host, host.createHash);
92318
92272
  const { buildInfoPath, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath } = getOutputPathsForBundle(config.options, false);
92319
92273
  const buildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
92320
92274
  if (!buildInfo)
@@ -92324,22 +92278,22 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
92324
92278
  const jsFileText = host.readFile(Debug.checkDefined(jsFilePath));
92325
92279
  if (!jsFileText)
92326
92280
  return jsFilePath;
92327
- if (computeSignature(jsFileText, createHash) !== buildInfo.bundle.js.hash)
92281
+ if (computeSignature(jsFileText, host) !== buildInfo.bundle.js.hash)
92328
92282
  return jsFilePath;
92329
92283
  const sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
92330
92284
  if (sourceMapFilePath && !sourceMapText || config.options.inlineSourceMap)
92331
92285
  return sourceMapFilePath || "inline sourcemap decoding";
92332
- if (sourceMapFilePath && computeSignature(sourceMapText, createHash) !== buildInfo.bundle.js.mapHash)
92286
+ if (sourceMapFilePath && computeSignature(sourceMapText, host) !== buildInfo.bundle.js.mapHash)
92333
92287
  return sourceMapFilePath;
92334
92288
  const declarationText = declarationFilePath && host.readFile(declarationFilePath);
92335
92289
  if (declarationFilePath && !declarationText)
92336
92290
  return declarationFilePath;
92337
- if (declarationFilePath && computeSignature(declarationText, createHash) !== buildInfo.bundle.dts.hash)
92291
+ if (declarationFilePath && computeSignature(declarationText, host) !== buildInfo.bundle.dts.hash)
92338
92292
  return declarationFilePath;
92339
92293
  const declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
92340
92294
  if (declarationMapPath && !declarationMapText || config.options.inlineSourceMap)
92341
92295
  return declarationMapPath || "inline sourcemap decoding";
92342
- if (declarationMapPath && computeSignature(declarationMapText, createHash) !== buildInfo.bundle.dts.mapHash)
92296
+ if (declarationMapPath && computeSignature(declarationMapText, host) !== buildInfo.bundle.dts.mapHash)
92343
92297
  return declarationMapPath;
92344
92298
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
92345
92299
  const ownPrependInput = createInputFilesWithFileTexts(
@@ -92409,7 +92363,7 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
92409
92363
  getBuildInfo: (bundle) => {
92410
92364
  const program = buildInfo.program;
92411
92365
  if (program && changedDtsText !== void 0 && config.options.composite) {
92412
- program.outSignature = computeSignature(changedDtsText, createHash, changedDtsData);
92366
+ program.outSignature = computeSignature(changedDtsText, host, changedDtsData);
92413
92367
  }
92414
92368
  const { js, dts, sourceFiles } = buildInfo.bundle;
92415
92369
  bundle.js.sources = js.sources;
@@ -92422,7 +92376,7 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
92422
92376
  getSourceFileFromReference: returnUndefined,
92423
92377
  redirectTargetsMap: createMultiMap(),
92424
92378
  getFileIncludeReasons: notImplemented,
92425
- createHash
92379
+ createHash: maybeBind(host, host.createHash)
92426
92380
  };
92427
92381
  emitFiles(
92428
92382
  notImplementedResolver,
@@ -100479,7 +100433,7 @@ var BuilderState;
100479
100433
  return oldState && !oldState.referencedMap === !newReferencedMap;
100480
100434
  }
100481
100435
  BuilderState2.canReuseOldState = canReuseOldState;
100482
- function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
100436
+ function create(newProgram, oldState, disableUseFileVersionAsSignature) {
100483
100437
  var _a2, _b, _c;
100484
100438
  const fileInfos = /* @__PURE__ */ new Map();
100485
100439
  const options = newProgram.getCompilerOptions();
@@ -100487,6 +100441,7 @@ var BuilderState;
100487
100441
  const referencedMap = options.module !== 0 /* None */ && !isOutFile ? createManyToManyPathMap() : void 0;
100488
100442
  const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0;
100489
100443
  const useOldState = canReuseOldState(referencedMap, oldState);
100444
+ const getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames());
100490
100445
  newProgram.getTypeChecker();
100491
100446
  for (const sourceFile of newProgram.getSourceFiles()) {
100492
100447
  const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
@@ -100525,30 +100480,29 @@ var BuilderState;
100525
100480
  state.allFileNames = void 0;
100526
100481
  }
100527
100482
  BuilderState2.releaseCache = releaseCache2;
100528
- function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, getCanonicalFileName) {
100483
+ function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, host) {
100529
100484
  var _a2, _b;
100530
100485
  const result = getFilesAffectedByWithOldState(
100531
100486
  state,
100532
100487
  programOfThisState,
100533
100488
  path,
100534
100489
  cancellationToken,
100535
- computeHash,
100536
- getCanonicalFileName
100490
+ host
100537
100491
  );
100538
100492
  (_a2 = state.oldSignatures) == null ? void 0 : _a2.clear();
100539
100493
  (_b = state.oldExportedModulesMap) == null ? void 0 : _b.clear();
100540
100494
  return result;
100541
100495
  }
100542
100496
  BuilderState2.getFilesAffectedBy = getFilesAffectedBy;
100543
- function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash, getCanonicalFileName) {
100497
+ function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, host) {
100544
100498
  const sourceFile = programOfThisState.getSourceFileByPath(path);
100545
100499
  if (!sourceFile) {
100546
100500
  return emptyArray;
100547
100501
  }
100548
- if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName)) {
100502
+ if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host)) {
100549
100503
  return [sourceFile];
100550
100504
  }
100551
- return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName);
100505
+ return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, host);
100552
100506
  }
100553
100507
  BuilderState2.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
100554
100508
  function updateSignatureOfFile(state, signature, path) {
@@ -100556,7 +100510,7 @@ var BuilderState;
100556
100510
  (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path);
100557
100511
  }
100558
100512
  BuilderState2.updateSignatureOfFile = updateSignatureOfFile;
100559
- function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName, useFileVersionAsSignature = state.useFileVersionAsSignature) {
100513
+ function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) {
100560
100514
  var _a2;
100561
100515
  if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath))
100562
100516
  return false;
@@ -100569,10 +100523,10 @@ var BuilderState;
100569
100523
  (fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
100570
100524
  Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
100571
100525
  latestSignature = computeSignatureWithDiagnostics(
100526
+ programOfThisState,
100572
100527
  sourceFile,
100573
100528
  text,
100574
- computeHash,
100575
- getCanonicalFileName,
100529
+ host,
100576
100530
  data
100577
100531
  );
100578
100532
  if (latestSignature !== prevSignature) {
@@ -100711,7 +100665,7 @@ var BuilderState;
100711
100665
  }
100712
100666
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
100713
100667
  }
100714
- function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash, getCanonicalFileName) {
100668
+ function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, host) {
100715
100669
  if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
100716
100670
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
100717
100671
  }
@@ -100727,7 +100681,7 @@ var BuilderState;
100727
100681
  if (!seenFileNamesMap.has(currentPath)) {
100728
100682
  const currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
100729
100683
  seenFileNamesMap.set(currentPath, currentSourceFile);
100730
- if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash, getCanonicalFileName)) {
100684
+ if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, host)) {
100731
100685
  queue.push(...getReferencedByPaths(state, currentSourceFile.resolvedPath));
100732
100686
  }
100733
100687
  }
@@ -100769,9 +100723,9 @@ function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) {
100769
100723
  function hasSameKeys(map1, map2) {
100770
100724
  return map1 === map2 || map1 !== void 0 && map2 !== void 0 && map1.size === map2.size && !forEachKey(map1, (key) => !map2.has(key));
100771
100725
  }
100772
- function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
100726
+ function createBuilderProgramState(newProgram, oldState, disableUseFileVersionAsSignature) {
100773
100727
  var _a2, _b;
100774
- const state = BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature);
100728
+ const state = BuilderState.create(newProgram, oldState, disableUseFileVersionAsSignature);
100775
100729
  state.program = newProgram;
100776
100730
  const compilerOptions = newProgram.getCompilerOptions();
100777
100731
  state.compilerOptions = compilerOptions;
@@ -100815,7 +100769,7 @@ function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, d
100815
100769
  return;
100816
100770
  const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
100817
100771
  if (diagnostics) {
100818
- state.semanticDiagnosticsPerFile.set(sourceFilePath, oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) : diagnostics);
100772
+ state.semanticDiagnosticsPerFile.set(sourceFilePath, oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram) : diagnostics);
100819
100773
  if (!state.semanticDiagnosticsFromOldState) {
100820
100774
  state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set();
100821
100775
  }
@@ -100875,10 +100829,11 @@ function addFileToChangeSet(state, path) {
100875
100829
  function getEmitSignatureFromOldSignature(options, oldOptions, oldEmitSignature) {
100876
100830
  return !!options.declarationMap === !!oldOptions.declarationMap ? oldEmitSignature : isString(oldEmitSignature) ? [oldEmitSignature] : oldEmitSignature[0];
100877
100831
  }
100878
- function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
100832
+ function convertToDiagnostics(diagnostics, newProgram) {
100879
100833
  if (!diagnostics.length)
100880
100834
  return emptyArray;
100881
- const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
100835
+ let buildInfoDirectory;
100836
+ let getCanonicalFileName;
100882
100837
  return diagnostics.map((diagnostic) => {
100883
100838
  const result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3);
100884
100839
  result.reportsUnnecessary = diagnostic.reportsUnnecessary;
@@ -100890,7 +100845,8 @@ function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
100890
100845
  return result;
100891
100846
  });
100892
100847
  function toPath3(path) {
100893
- return toPath(path, buildInfoDirectory, getCanonicalFileName);
100848
+ buildInfoDirectory != null ? buildInfoDirectory : buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
100849
+ return toPath(path, buildInfoDirectory, getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames()));
100894
100850
  }
100895
100851
  }
100896
100852
  function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) {
@@ -100932,7 +100888,7 @@ function restoreBuilderProgramEmitState(state, savedEmitState) {
100932
100888
  function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) {
100933
100889
  Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath));
100934
100890
  }
100935
- function getNextAffectedFile(state, cancellationToken, computeHash, getCanonicalFileName, host) {
100891
+ function getNextAffectedFile(state, cancellationToken, host) {
100936
100892
  var _a2, _b;
100937
100893
  while (true) {
100938
100894
  const { affectedFiles } = state;
@@ -100948,8 +100904,6 @@ function getNextAffectedFile(state, cancellationToken, computeHash, getCanonical
100948
100904
  state,
100949
100905
  affectedFile,
100950
100906
  cancellationToken,
100951
- computeHash,
100952
- getCanonicalFileName,
100953
100907
  host
100954
100908
  );
100955
100909
  return affectedFile;
@@ -100977,8 +100931,7 @@ function getNextAffectedFile(state, cancellationToken, computeHash, getCanonical
100977
100931
  program,
100978
100932
  nextKey.value,
100979
100933
  cancellationToken,
100980
- computeHash,
100981
- getCanonicalFileName
100934
+ host
100982
100935
  );
100983
100936
  state.currentChangedFilePath = nextKey.value;
100984
100937
  state.affectedFilesIndex = 0;
@@ -101030,7 +100983,7 @@ function removeDiagnosticsOfLibraryFiles(state) {
101030
100983
  );
101031
100984
  }
101032
100985
  }
101033
- function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host) {
100986
+ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
101034
100987
  removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
101035
100988
  if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
101036
100989
  removeDiagnosticsOfLibraryFiles(state);
@@ -101039,8 +100992,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
101039
100992
  Debug.checkDefined(state.program),
101040
100993
  affectedFile,
101041
100994
  cancellationToken,
101042
- computeHash,
101043
- getCanonicalFileName
100995
+ host
101044
100996
  );
101045
100997
  return;
101046
100998
  }
@@ -101050,12 +101002,10 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
101050
101002
  state,
101051
101003
  affectedFile,
101052
101004
  cancellationToken,
101053
- computeHash,
101054
- getCanonicalFileName,
101055
101005
  host
101056
101006
  );
101057
101007
  }
101058
- function handleDtsMayChangeOf(state, path, cancellationToken, computeHash, getCanonicalFileName, host) {
101008
+ function handleDtsMayChangeOf(state, path, cancellationToken, host) {
101059
101009
  removeSemanticDiagnosticsOf(state, path);
101060
101010
  if (!state.changedFilesSet.has(path)) {
101061
101011
  const program = Debug.checkDefined(state.program);
@@ -101066,8 +101016,7 @@ function handleDtsMayChangeOf(state, path, cancellationToken, computeHash, getCa
101066
101016
  program,
101067
101017
  sourceFile,
101068
101018
  cancellationToken,
101069
- computeHash,
101070
- getCanonicalFileName,
101019
+ host,
101071
101020
  !host.disableUseFileVersionAsSignature
101072
101021
  );
101073
101022
  if (getEmitDeclarations(state.compilerOptions)) {
@@ -101089,7 +101038,7 @@ function isChangedSignature(state, path) {
101089
101038
  const newSignature = Debug.checkDefined(state.fileInfos.get(path)).signature;
101090
101039
  return newSignature !== oldSignature;
101091
101040
  }
101092
- function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, getCanonicalFileName, host) {
101041
+ function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host) {
101093
101042
  var _a2;
101094
101043
  if (!((_a2 = state.fileInfos.get(filePath)) == null ? void 0 : _a2.affectsGlobalScope))
101095
101044
  return false;
@@ -101097,14 +101046,12 @@ function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, com
101097
101046
  state,
101098
101047
  file.resolvedPath,
101099
101048
  cancellationToken,
101100
- computeHash,
101101
- getCanonicalFileName,
101102
101049
  host
101103
101050
  ));
101104
101051
  removeDiagnosticsOfLibraryFiles(state);
101105
101052
  return true;
101106
101053
  }
101107
- function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host) {
101054
+ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, host) {
101108
101055
  var _a2;
101109
101056
  if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
101110
101057
  return;
@@ -101118,9 +101065,9 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
101118
101065
  const currentPath = queue.pop();
101119
101066
  if (!seenFileNamesMap.has(currentPath)) {
101120
101067
  seenFileNamesMap.set(currentPath, true);
101121
- if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, computeHash, getCanonicalFileName, host))
101068
+ if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, host))
101122
101069
  return;
101123
- handleDtsMayChangeOf(state, currentPath, cancellationToken, computeHash, getCanonicalFileName, host);
101070
+ handleDtsMayChangeOf(state, currentPath, cancellationToken, host);
101124
101071
  if (isChangedSignature(state, currentPath)) {
101125
101072
  const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath);
101126
101073
  queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
@@ -101130,7 +101077,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
101130
101077
  }
101131
101078
  const seenFileAndExportsOfFile = /* @__PURE__ */ new Set();
101132
101079
  (_a2 = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) == null ? void 0 : _a2.forEach((exportedFromPath) => {
101133
- if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, getCanonicalFileName, host))
101080
+ if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, host))
101134
101081
  return true;
101135
101082
  const references = state.referencedMap.getKeys(exportedFromPath);
101136
101083
  return references && forEachKey(
@@ -101140,28 +101087,24 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
101140
101087
  filePath,
101141
101088
  seenFileAndExportsOfFile,
101142
101089
  cancellationToken,
101143
- computeHash,
101144
- getCanonicalFileName,
101145
101090
  host
101146
101091
  )
101147
101092
  );
101148
101093
  });
101149
101094
  }
101150
- function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, getCanonicalFileName, host) {
101095
+ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, host) {
101151
101096
  var _a2, _b;
101152
101097
  if (!tryAddToSet(seenFileAndExportsOfFile, filePath))
101153
101098
  return void 0;
101154
- if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, getCanonicalFileName, host))
101099
+ if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host))
101155
101100
  return true;
101156
- handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, getCanonicalFileName, host);
101101
+ handleDtsMayChangeOf(state, filePath, cancellationToken, host);
101157
101102
  (_a2 = state.exportedModulesMap.getKeys(filePath)) == null ? void 0 : _a2.forEach(
101158
101103
  (exportedFromPath) => handleDtsMayChangeOfFileAndExportsOfFile(
101159
101104
  state,
101160
101105
  exportedFromPath,
101161
101106
  seenFileAndExportsOfFile,
101162
101107
  cancellationToken,
101163
- computeHash,
101164
- getCanonicalFileName,
101165
101108
  host
101166
101109
  )
101167
101110
  );
@@ -101170,8 +101113,6 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndEx
101170
101113
  state,
101171
101114
  referencingFilePath,
101172
101115
  cancellationToken,
101173
- computeHash,
101174
- getCanonicalFileName,
101175
101116
  host
101176
101117
  )
101177
101118
  );
@@ -101200,9 +101141,10 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
101200
101141
  function isProgramBundleEmitBuildInfo(info) {
101201
101142
  return !!outFile(info.options || {});
101202
101143
  }
101203
- function getBuildInfo2(state, getCanonicalFileName, bundle) {
101144
+ function getBuildInfo2(state, bundle) {
101204
101145
  var _a2, _b, _c;
101205
101146
  const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
101147
+ const getCanonicalFileName = createGetCanonicalFileName(state.program.useCaseSensitiveFileNames());
101206
101148
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
101207
101149
  const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
101208
101150
  const fileNames = [];
@@ -101421,8 +101363,9 @@ function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldP
101421
101363
  function getTextHandlingSourceMapForSignature(text, data) {
101422
101364
  return (data == null ? void 0 : data.sourceMapUrlPos) !== void 0 ? text.substring(0, data.sourceMapUrlPos) : text;
101423
101365
  }
101424
- function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanonicalFileName, data) {
101425
- var _a2;
101366
+ function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) {
101367
+ var _a2, _b;
101368
+ let getCanonicalFileName;
101426
101369
  text = getTextHandlingSourceMapForSignature(text, data);
101427
101370
  let sourceFileDirectory;
101428
101371
  if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) {
@@ -101430,7 +101373,7 @@ function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanon
101430
101373
  (diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}`
101431
101374
  ).join("\n");
101432
101375
  }
101433
- return (computeHash != null ? computeHash : generateDjb2Hash)(text);
101376
+ return ((_b = host.createHash) != null ? _b : generateDjb2Hash)(text);
101434
101377
  function flattenDiagnosticMessageText2(diagnostic) {
101435
101378
  return isString(diagnostic) ? diagnostic : diagnostic === void 0 ? "" : !diagnostic.next ? diagnostic.messageText : diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText2).join("\n");
101436
101379
  }
@@ -101439,11 +101382,16 @@ function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanon
101439
101382
  return `(${diagnostic.start},${diagnostic.length})`;
101440
101383
  if (sourceFileDirectory === void 0)
101441
101384
  sourceFileDirectory = getDirectoryPath(sourceFile.resolvedPath);
101442
- return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceFileDirectory, diagnostic.file.resolvedPath, getCanonicalFileName))}(${diagnostic.start},${diagnostic.length})`;
101385
+ return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
101386
+ sourceFileDirectory,
101387
+ diagnostic.file.resolvedPath,
101388
+ getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames())
101389
+ ))}(${diagnostic.start},${diagnostic.length})`;
101443
101390
  }
101444
101391
  }
101445
- function computeSignature(text, computeHash, data) {
101446
- return (computeHash != null ? computeHash : generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
101392
+ function computeSignature(text, host, data) {
101393
+ var _a2;
101394
+ return ((_a2 = host.createHash) != null ? _a2 : generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
101447
101395
  }
101448
101396
  function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) {
101449
101397
  let oldState = oldProgram && oldProgram.getState();
@@ -101452,10 +101400,8 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
101452
101400
  oldState = void 0;
101453
101401
  return oldProgram;
101454
101402
  }
101455
- const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
101456
- const computeHash = maybeBind(host, host.createHash);
101457
- const state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
101458
- newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, getCanonicalFileName, bundle);
101403
+ const state = createBuilderProgramState(newProgram, oldState, host.disableUseFileVersionAsSignature);
101404
+ newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, bundle);
101459
101405
  newProgram = void 0;
101460
101406
  oldProgram = void 0;
101461
101407
  oldState = void 0;
@@ -101489,7 +101435,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
101489
101435
  }
101490
101436
  function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
101491
101437
  var _a2, _b, _c, _d, _e;
101492
- let affected = getNextAffectedFile(state, cancellationToken, computeHash, getCanonicalFileName, host);
101438
+ let affected = getNextAffectedFile(state, cancellationToken, host);
101493
101439
  const programEmitKind = getBuilderFileEmit(state.compilerOptions);
101494
101440
  let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 /* AllDts */ : programEmitKind;
101495
101441
  if (!affected) {
@@ -101563,10 +101509,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
101563
101509
  const info = state.fileInfos.get(file.resolvedPath);
101564
101510
  if (info.signature === file.version) {
101565
101511
  const signature = computeSignatureWithDiagnostics(
101512
+ state.program,
101566
101513
  file,
101567
101514
  text,
101568
- computeHash,
101569
- getCanonicalFileName,
101515
+ host,
101570
101516
  data
101571
101517
  );
101572
101518
  if (!((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length))
@@ -101610,7 +101556,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
101610
101556
  state.program.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
101611
101557
  function handleNewSignature(oldSignatureFormat, newSignature) {
101612
101558
  const oldSignature = !oldSignatureFormat || isString(oldSignatureFormat) ? oldSignatureFormat : oldSignatureFormat[0];
101613
- newSignature != null ? newSignature : newSignature = computeSignature(text, computeHash, data);
101559
+ newSignature != null ? newSignature : newSignature = computeSignature(text, host, data);
101614
101560
  if (newSignature === oldSignature) {
101615
101561
  if (oldSignatureFormat === oldSignature)
101616
101562
  return void 0;
@@ -101666,7 +101612,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
101666
101612
  }
101667
101613
  function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
101668
101614
  while (true) {
101669
- const affected = getNextAffectedFile(state, cancellationToken, computeHash, getCanonicalFileName, host);
101615
+ const affected = getNextAffectedFile(state, cancellationToken, host);
101670
101616
  let result;
101671
101617
  if (!affected)
101672
101618
  return void 0;