typescript 5.0.0-dev.20221206 → 5.0.0-dev.20221208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-dev.20221206`;
26
+ var version = `${versionMajorMinor}.0-dev.20221208`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -1695,22 +1695,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1695
1695
  function enableDebugInfo() {
1696
1696
  if (isDebugInfoEnabled)
1697
1697
  return;
1698
- let weakTypeTextMap;
1699
- let weakNodeTextMap;
1700
- function getWeakTypeTextMap() {
1701
- if (weakTypeTextMap === void 0) {
1702
- if (typeof WeakMap === "function")
1703
- weakTypeTextMap = /* @__PURE__ */ new WeakMap();
1704
- }
1705
- return weakTypeTextMap;
1706
- }
1707
- function getWeakNodeTextMap() {
1708
- if (weakNodeTextMap === void 0) {
1709
- if (typeof WeakMap === "function")
1710
- weakNodeTextMap = /* @__PURE__ */ new WeakMap();
1711
- }
1712
- return weakNodeTextMap;
1713
- }
1698
+ const weakTypeTextMap = /* @__PURE__ */ new WeakMap();
1699
+ const weakNodeTextMap = /* @__PURE__ */ new WeakMap();
1714
1700
  Object.defineProperties(objectAllocator.getSymbolConstructor().prototype, {
1715
1701
  __tsDebuggerDisplay: {
1716
1702
  value() {
@@ -1739,11 +1725,10 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1739
1725
  } },
1740
1726
  __debugTypeToString: {
1741
1727
  value() {
1742
- const map2 = getWeakTypeTextMap();
1743
- let text = map2 == null ? void 0 : map2.get(this);
1728
+ let text = weakTypeTextMap.get(this);
1744
1729
  if (text === void 0) {
1745
1730
  text = this.checker.typeToString(this);
1746
- map2 == null ? void 0 : map2.set(this, text);
1731
+ weakTypeTextMap.set(this, text);
1747
1732
  }
1748
1733
  return text;
1749
1734
  }
@@ -1795,13 +1780,12 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1795
1780
  value(includeTrivia) {
1796
1781
  if (nodeIsSynthesized(this))
1797
1782
  return "";
1798
- const map2 = getWeakNodeTextMap();
1799
- let text = map2 == null ? void 0 : map2.get(this);
1783
+ let text = weakNodeTextMap.get(this);
1800
1784
  if (text === void 0) {
1801
1785
  const parseNode = getParseTreeNode(this);
1802
1786
  const sourceFile = parseNode && getSourceFileOfNode(parseNode);
1803
1787
  text = sourceFile ? getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : "";
1804
- map2 == null ? void 0 : map2.set(this, text);
1788
+ weakNodeTextMap.set(this, text);
1805
1789
  }
1806
1790
  return text;
1807
1791
  }
@@ -32876,8 +32860,10 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
32876
32860
  options = redirectedReference.commandLine.options;
32877
32861
  }
32878
32862
  const containingDirectory = containingFile ? getDirectoryPath(containingFile) : void 0;
32879
- const perFolderCache = containingDirectory ? cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference) : void 0;
32880
- let result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName, resolutionMode);
32863
+ let result = containingDirectory ? cache == null ? void 0 : cache.getFromDirectoryCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference) : void 0;
32864
+ if (!result && containingDirectory && !isExternalModuleNameRelative(typeReferenceDirectiveName)) {
32865
+ result = cache == null ? void 0 : cache.getFromNonRelativeNameCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference);
32866
+ }
32881
32867
  if (result) {
32882
32868
  if (traceEnabled) {
32883
32869
  trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
@@ -32953,7 +32939,12 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
32953
32939
  affectingLocations: initializeResolutionField(affectingLocations),
32954
32940
  resolutionDiagnostics: initializeResolutionField(diagnostics)
32955
32941
  };
32956
- perFolderCache == null ? void 0 : perFolderCache.set(typeReferenceDirectiveName, resolutionMode, result);
32942
+ if (containingDirectory) {
32943
+ cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(typeReferenceDirectiveName, resolutionMode, result);
32944
+ if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) {
32945
+ cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result);
32946
+ }
32947
+ }
32957
32948
  if (traceEnabled)
32958
32949
  traceResult(result);
32959
32950
  return result;
@@ -33073,23 +33064,27 @@ function createCacheWithRedirects(ownOptions) {
33073
33064
  if (ownOptions)
33074
33065
  redirectsMap.set(ownOptions, ownMap);
33075
33066
  return {
33067
+ getMapOfCacheRedirects,
33076
33068
  getOrCreateMapOfCacheRedirects,
33077
33069
  update,
33078
33070
  clear: clear2
33079
33071
  };
33072
+ function getMapOfCacheRedirects(redirectedReference) {
33073
+ return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options, false) : ownMap;
33074
+ }
33080
33075
  function getOrCreateMapOfCacheRedirects(redirectedReference) {
33081
- return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options) : ownMap;
33076
+ return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options, true) : ownMap;
33082
33077
  }
33083
33078
  function update(newOptions) {
33084
33079
  if (ownOptions !== newOptions) {
33085
33080
  if (ownOptions)
33086
- ownMap = getOrCreateMap(newOptions);
33081
+ ownMap = getOrCreateMap(newOptions, true);
33087
33082
  else
33088
33083
  redirectsMap.set(newOptions, ownMap);
33089
33084
  ownOptions = newOptions;
33090
33085
  }
33091
33086
  }
33092
- function getOrCreateMap(redirectOptions) {
33087
+ function getOrCreateMap(redirectOptions, create) {
33093
33088
  let result = redirectsMap.get(redirectOptions);
33094
33089
  if (result)
33095
33090
  return result;
@@ -33103,9 +33098,13 @@ function createCacheWithRedirects(ownOptions) {
33103
33098
  else if (!redirectsKeyToMap.has(ownKey))
33104
33099
  redirectsKeyToMap.set(ownKey, ownMap);
33105
33100
  }
33106
- redirectsKeyToMap.set(key, result != null ? result : result = /* @__PURE__ */ new Map());
33101
+ if (create)
33102
+ result != null ? result : result = /* @__PURE__ */ new Map();
33103
+ if (result)
33104
+ redirectsKeyToMap.set(key, result);
33107
33105
  }
33108
- redirectsMap.set(redirectOptions, result);
33106
+ if (result)
33107
+ redirectsMap.set(redirectOptions, result);
33109
33108
  return result;
33110
33109
  }
33111
33110
  function clear2() {
@@ -33157,8 +33156,10 @@ function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create)
33157
33156
  }
33158
33157
  return result;
33159
33158
  }
33160
- function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap) {
33159
+ function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options) {
33160
+ const directoryToModuleNameMap = createCacheWithRedirects(options);
33161
33161
  return {
33162
+ getFromDirectoryCache,
33162
33163
  getOrCreateCacheForDirectory,
33163
33164
  clear: clear2,
33164
33165
  update
@@ -33166,13 +33167,18 @@ function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileNam
33166
33167
  function clear2() {
33167
33168
  directoryToModuleNameMap.clear();
33168
33169
  }
33169
- function update(options) {
33170
- directoryToModuleNameMap.update(options);
33170
+ function update(options2) {
33171
+ directoryToModuleNameMap.update(options2);
33171
33172
  }
33172
33173
  function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
33173
33174
  const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
33174
33175
  return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, () => createModeAwareCache());
33175
33176
  }
33177
+ function getFromDirectoryCache(name, mode, directoryName, redirectedReference) {
33178
+ var _a2, _b;
33179
+ const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
33180
+ return (_b = (_a2 = directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(path)) == null ? void 0 : _b.get(name, mode);
33181
+ }
33176
33182
  }
33177
33183
  function createModeAwareCacheKey(specifier, mode) {
33178
33184
  return mode === void 0 ? specifier : `${mode}|${specifier}`;
@@ -33221,33 +33227,32 @@ function zipToModeAwareCache(file, keys, values, nameAndModeGetter) {
33221
33227
  }
33222
33228
  return map2;
33223
33229
  }
33224
- function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) {
33225
- const directoryToModuleNameMap = createCacheWithRedirects(options);
33226
- const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap);
33230
+ function getOriginalOrResolvedModuleFileName(result) {
33231
+ return result.resolvedModule && (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName);
33232
+ }
33233
+ function getOriginalOrResolvedTypeReferenceFileName(result) {
33234
+ return result.resolvedTypeReferenceDirective && (result.resolvedTypeReferenceDirective.originalPath || result.resolvedTypeReferenceDirective.resolvedFileName);
33235
+ }
33236
+ function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName) {
33227
33237
  const moduleNameToDirectoryMap = createCacheWithRedirects(options);
33228
- const packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
33229
33238
  return {
33230
- ...packageJsonInfoCache,
33231
- ...perDirectoryResolutionCache,
33232
- getOrCreateCacheForModuleName,
33239
+ getFromNonRelativeNameCache,
33240
+ getOrCreateCacheForNonRelativeName,
33233
33241
  clear: clear2,
33234
- update,
33235
- getPackageJsonInfoCache: () => packageJsonInfoCache,
33236
- clearAllExceptPackageJsonInfoCache
33242
+ update
33237
33243
  };
33238
33244
  function clear2() {
33239
- clearAllExceptPackageJsonInfoCache();
33240
- packageJsonInfoCache.clear();
33241
- }
33242
- function clearAllExceptPackageJsonInfoCache() {
33243
- perDirectoryResolutionCache.clear();
33244
33245
  moduleNameToDirectoryMap.clear();
33245
33246
  }
33246
33247
  function update(options2) {
33247
- directoryToModuleNameMap.update(options2);
33248
33248
  moduleNameToDirectoryMap.update(options2);
33249
33249
  }
33250
- function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
33250
+ function getFromNonRelativeNameCache(nonRelativeModuleName, mode, directoryName, redirectedReference) {
33251
+ var _a2, _b;
33252
+ Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
33253
+ return (_b = (_a2 = moduleNameToDirectoryMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(createModeAwareCacheKey(nonRelativeModuleName, mode))) == null ? void 0 : _b.get(directoryName);
33254
+ }
33255
+ function getOrCreateCacheForNonRelativeName(nonRelativeModuleName, mode, redirectedReference) {
33251
33256
  Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
33252
33257
  return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, createModeAwareCacheKey(nonRelativeModuleName, mode), createPerModuleNameCache);
33253
33258
  }
@@ -33263,7 +33268,7 @@ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, opt
33263
33268
  return;
33264
33269
  }
33265
33270
  directoryPathMap.set(path, result);
33266
- const resolvedFileName = result.resolvedModule && (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName);
33271
+ const resolvedFileName = getResolvedFileName(result);
33267
33272
  const commonPrefix = resolvedFileName && getCommonPrefix(path, resolvedFileName);
33268
33273
  let current = path;
33269
33274
  while (current !== commonPrefix) {
@@ -33297,14 +33302,22 @@ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, opt
33297
33302
  }
33298
33303
  }
33299
33304
  }
33300
- function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
33301
- const directoryToModuleNameMap = createCacheWithRedirects(options);
33302
- const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap);
33303
- packageJsonInfoCache || (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName));
33305
+ function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName) {
33306
+ const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options);
33307
+ const nonRelativeNameResolutionCache = createNonRelativeNameResolutionCache(
33308
+ currentDirectory,
33309
+ getCanonicalFileName,
33310
+ options,
33311
+ getResolvedFileName
33312
+ );
33313
+ packageJsonInfoCache != null ? packageJsonInfoCache : packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
33304
33314
  return {
33305
33315
  ...packageJsonInfoCache,
33306
33316
  ...perDirectoryResolutionCache,
33317
+ ...nonRelativeNameResolutionCache,
33307
33318
  clear: clear2,
33319
+ update,
33320
+ getPackageJsonInfoCache: () => packageJsonInfoCache,
33308
33321
  clearAllExceptPackageJsonInfoCache
33309
33322
  };
33310
33323
  function clear2() {
@@ -33313,8 +33326,33 @@ function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanoni
33313
33326
  }
33314
33327
  function clearAllExceptPackageJsonInfoCache() {
33315
33328
  perDirectoryResolutionCache.clear();
33329
+ nonRelativeNameResolutionCache.clear();
33330
+ }
33331
+ function update(options2) {
33332
+ perDirectoryResolutionCache.update(options2);
33333
+ nonRelativeNameResolutionCache.update(options2);
33316
33334
  }
33317
33335
  }
33336
+ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) {
33337
+ const result = createModuleOrTypeReferenceResolutionCache(
33338
+ currentDirectory,
33339
+ getCanonicalFileName,
33340
+ options,
33341
+ void 0,
33342
+ getOriginalOrResolvedModuleFileName
33343
+ );
33344
+ result.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference);
33345
+ return result;
33346
+ }
33347
+ function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
33348
+ return createModuleOrTypeReferenceResolutionCache(
33349
+ currentDirectory,
33350
+ getCanonicalFileName,
33351
+ options,
33352
+ packageJsonInfoCache,
33353
+ getOriginalOrResolvedTypeReferenceFileName
33354
+ );
33355
+ }
33318
33356
  function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
33319
33357
  const traceEnabled = isTraceEnabled(compilerOptions, host);
33320
33358
  if (redirectedReference) {
@@ -33327,8 +33365,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
33327
33365
  }
33328
33366
  }
33329
33367
  const containingDirectory = getDirectoryPath(containingFile);
33330
- const perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference);
33331
- let result = perFolderCache && perFolderCache.get(moduleName, resolutionMode);
33368
+ let result = cache == null ? void 0 : cache.getFromDirectoryCache(moduleName, resolutionMode, containingDirectory, redirectedReference);
33332
33369
  if (result) {
33333
33370
  if (traceEnabled) {
33334
33371
  trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
@@ -33378,11 +33415,9 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
33378
33415
  if (result && result.resolvedModule)
33379
33416
  perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
33380
33417
  perfLogger.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
33381
- if (perFolderCache) {
33382
- perFolderCache.set(moduleName, resolutionMode, result);
33383
- if (!isExternalModuleNameRelative(moduleName)) {
33384
- cache.getOrCreateCacheForModuleName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
33385
- }
33418
+ cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
33419
+ if (!isExternalModuleNameRelative(moduleName)) {
33420
+ cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
33386
33421
  }
33387
33422
  }
33388
33423
  if (traceEnabled) {
@@ -34292,7 +34327,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
34292
34327
  return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* Declaration */, moduleName, directory, state, true, void 0, void 0);
34293
34328
  }
34294
34329
  function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
34295
- const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */, redirectedReference);
34330
+ const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
34296
34331
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
34297
34332
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
34298
34333
  if (priorityExtensions) {
@@ -34306,7 +34341,7 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
34306
34341
  function lookup(extensions2) {
34307
34342
  return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
34308
34343
  if (getBaseFileName(ancestorDirectory) !== "node_modules") {
34309
- const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state);
34344
+ const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
34310
34345
  if (resolutionFromCache) {
34311
34346
  return resolutionFromCache;
34312
34347
  }
@@ -34452,8 +34487,8 @@ function getPackageNameFromTypesPackageName(mangledName) {
34452
34487
  function unmangleScopedPackageName(typesPackageName) {
34453
34488
  return stringContains(typesPackageName, mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
34454
34489
  }
34455
- function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) {
34456
- const result = cache && cache.get(containingDirectory);
34490
+ function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
34491
+ const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
34457
34492
  if (result) {
34458
34493
  if (state.traceEnabled) {
34459
34494
  trace(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
@@ -34496,9 +34531,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
34496
34531
  return { value: resolvedUsingSettings };
34497
34532
  }
34498
34533
  if (!isExternalModuleNameRelative(moduleName)) {
34499
- const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, void 0, redirectedReference);
34500
34534
  const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => {
34501
- const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, state);
34535
+ const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, void 0, directory, redirectedReference, state);
34502
34536
  if (resolutionFromCache) {
34503
34537
  return resolutionFromCache;
34504
34538
  }
@@ -37839,7 +37873,7 @@ function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory,
37839
37873
  if (!shortest) {
37840
37874
  return void 0;
37841
37875
  }
37842
- return getEmitModuleResolutionKind(compilerOptions) === 2 /* NodeJs */ ? removeExtensionAndIndexPostFix(shortest, ending, compilerOptions) : removeFileExtension(shortest);
37876
+ return getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */ ? removeFileExtension(shortest) : removeExtensionAndIndexPostFix(shortest, ending, compilerOptions);
37843
37877
  }
37844
37878
  function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName, sourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
37845
37879
  if (!host.fileExists || !host.readFile) {
@@ -38611,8 +38645,9 @@ function createTypeChecker(host) {
38611
38645
  const nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown");
38612
38646
  const undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
38613
38647
  const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */);
38648
+ const missingType = createIntrinsicType(32768 /* Undefined */, "undefined");
38649
+ const undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType;
38614
38650
  const optionalType = createIntrinsicType(32768 /* Undefined */, "undefined");
38615
- const missingType = exactOptionalPropertyTypes ? createIntrinsicType(32768 /* Undefined */, "undefined") : undefinedType;
38616
38651
  const nullType = createIntrinsicType(65536 /* Null */, "null");
38617
38652
  const nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */);
38618
38653
  const stringType = createIntrinsicType(4 /* String */, "string");
@@ -48770,7 +48805,7 @@ function createTypeChecker(host) {
48770
48805
  return links.resolvedJSDocType;
48771
48806
  }
48772
48807
  function getSubstitutionType(baseType, constraint) {
48773
- if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || !isGenericType(baseType) && !isGenericType(constraint)) {
48808
+ if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) {
48774
48809
  return baseType;
48775
48810
  }
48776
48811
  const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
@@ -49510,10 +49545,9 @@ function createTypeChecker(host) {
49510
49545
  if (includes & 3 /* AnyOrUnknown */) {
49511
49546
  return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : includes & 65536 /* Null */ || containsType(typeSet, unknownType) ? unknownType : nonNullUnknownType;
49512
49547
  }
49513
- if (exactOptionalPropertyTypes && includes & 32768 /* Undefined */) {
49514
- const missingIndex = binarySearch(typeSet, missingType, getTypeId, compareValues);
49515
- if (missingIndex >= 0 && containsType(typeSet, undefinedType)) {
49516
- orderedRemoveItemAt(typeSet, missingIndex);
49548
+ if (includes & 32768 /* Undefined */) {
49549
+ if (typeSet.length >= 2 && typeSet[0] === undefinedType && typeSet[1] === missingType) {
49550
+ orderedRemoveItemAt(typeSet, 1);
49517
49551
  }
49518
49552
  }
49519
49553
  if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
@@ -49638,7 +49672,7 @@ function createTypeChecker(host) {
49638
49672
  if (type === wildcardType)
49639
49673
  includes |= 8388608 /* IncludesWildcard */;
49640
49674
  } else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
49641
- if (exactOptionalPropertyTypes && type === missingType) {
49675
+ if (type === missingType) {
49642
49676
  includes |= 262144 /* IncludesMissingType */;
49643
49677
  type = undefinedType;
49644
49678
  }
@@ -49788,9 +49822,9 @@ function createTypeChecker(host) {
49788
49822
  if (intersectUnionsOfPrimitiveTypes(typeSet)) {
49789
49823
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
49790
49824
  } else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
49791
- const undefinedOrMissingType = exactOptionalPropertyTypes && some(typeSet, (t) => containsType(t.types, missingType)) ? missingType : undefinedType;
49825
+ const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
49792
49826
  removeFromEach(typeSet, 32768 /* Undefined */);
49793
- result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
49827
+ result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
49794
49828
  } else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
49795
49829
  removeFromEach(typeSet, 65536 /* Null */);
49796
49830
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
@@ -50209,7 +50243,7 @@ function createTypeChecker(host) {
50209
50243
  errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
50210
50244
  return mapType(objectType, (t) => {
50211
50245
  const restType = getRestTypeOfTupleType(t) || undefinedType;
50212
- return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, undefinedType]) : restType;
50246
+ return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType;
50213
50247
  });
50214
50248
  }
50215
50249
  }
@@ -50229,11 +50263,11 @@ function createTypeChecker(host) {
50229
50263
  if (accessNode && indexInfo.keyType === stringType && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
50230
50264
  const indexNode = getIndexNodeForAccessExpression(accessNode);
50231
50265
  error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
50232
- return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
50266
+ return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
50233
50267
  }
50234
50268
  errorIfWritingToReadonlyIndex(indexInfo);
50235
50269
  if (accessFlags & 1 /* IncludeUndefined */ && !(objectType.symbol && objectType.symbol.flags & (256 /* RegularEnum */ | 128 /* ConstEnum */) && (indexType.symbol && indexType.flags & 1024 /* EnumLiteral */ && getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
50236
- return getUnionType([indexInfo.type, undefinedType]);
50270
+ return getUnionType([indexInfo.type, missingType]);
50237
50271
  }
50238
50272
  return indexInfo.type;
50239
50273
  }
@@ -54694,8 +54728,8 @@ function createTypeChecker(host) {
54694
54728
  }
54695
54729
  function getOptionalType(type, isProperty = false) {
54696
54730
  Debug.assert(strictNullChecks);
54697
- const missingOrUndefined = isProperty ? missingType : undefinedType;
54698
- return type.flags & 32768 /* Undefined */ || type.flags & 1048576 /* Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
54731
+ const missingOrUndefined = isProperty ? undefinedOrMissingType : undefinedType;
54732
+ return type === missingOrUndefined || type.flags & 1048576 /* Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
54699
54733
  }
54700
54734
  function getGlobalNonNullableTypeInstantiation(type) {
54701
54735
  if (!deferredGlobalNonNullableTypeAlias) {
@@ -54722,7 +54756,7 @@ function createTypeChecker(host) {
54722
54756
  return exactOptionalPropertyTypes && isOptional ? removeType(type, missingType) : type;
54723
54757
  }
54724
54758
  function containsMissingType(type) {
54725
- return exactOptionalPropertyTypes && (type === missingType || type.flags & 1048576 /* Union */ && containsType(type.types, missingType));
54759
+ return type === missingType || !!(type.flags & 1048576 /* Union */) && type.types[0] === missingType;
54726
54760
  }
54727
54761
  function removeMissingOrUndefinedType(type) {
54728
54762
  return exactOptionalPropertyTypes ? removeType(type, missingType) : getTypeWithFacts(type, 524288 /* NEUndefined */);
@@ -54822,7 +54856,7 @@ function createTypeChecker(host) {
54822
54856
  if (cached) {
54823
54857
  return cached;
54824
54858
  }
54825
- const result = createSymbolWithType(prop, missingType);
54859
+ const result = createSymbolWithType(prop, undefinedOrMissingType);
54826
54860
  result.flags |= 16777216 /* Optional */;
54827
54861
  undefinedProperties.set(prop.escapedName, result);
54828
54862
  return result;
@@ -55872,7 +55906,7 @@ function createTypeChecker(host) {
55872
55906
  }
55873
55907
  }
55874
55908
  function isTypeOrBaseIdenticalTo(s, t) {
55875
- return exactOptionalPropertyTypes && t === missingType ? s === t : isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */);
55909
+ return t === missingType ? s === t : isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */);
55876
55910
  }
55877
55911
  function isTypeCloselyMatchedBy(s, t) {
55878
55912
  return !!(s.flags & 524288 /* Object */ && t.flags & 524288 /* Object */ && s.symbol && s.symbol === t.symbol || s.aliasSymbol && s.aliasTypeArguments && s.aliasSymbol === t.aliasSymbol);
@@ -56401,7 +56435,7 @@ function createTypeChecker(host) {
56401
56435
  function includeUndefinedInIndexSignature(type) {
56402
56436
  if (!type)
56403
56437
  return type;
56404
- return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type, undefinedType]) : type;
56438
+ return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type;
56405
56439
  }
56406
56440
  function getTypeOfDestructuredSpreadExpression(type) {
56407
56441
  return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, void 0) || errorType);
@@ -57166,7 +57200,7 @@ function createTypeChecker(host) {
57166
57200
  if (bypassFlow) {
57167
57201
  const flowType = getTypeAtFlowNode(bypassFlow);
57168
57202
  const type = getTypeFromFlowType(flowType);
57169
- if (!contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) {
57203
+ if (!(type.flags & 131072 /* Never */) && !contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) {
57170
57204
  if (type === declaredType && declaredType === initialType) {
57171
57205
  return type;
57172
57206
  }
@@ -59305,7 +59339,7 @@ function createTypeChecker(host) {
59305
59339
  }
59306
59340
  } else if (exactOptionalPropertyTypes && e.kind === 229 /* OmittedExpression */) {
59307
59341
  hasOmittedExpression = true;
59308
- elementTypes.push(missingType);
59342
+ elementTypes.push(undefinedOrMissingType);
59309
59343
  elementFlags.push(2 /* Optional */);
59310
59344
  } else {
59311
59345
  const elementContextualType = getContextualTypeForElementExpression(contextualType, elementTypes.length);
@@ -60452,7 +60486,7 @@ function createTypeChecker(host) {
60452
60486
  if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) {
60453
60487
  error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
60454
60488
  }
60455
- propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
60489
+ propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
60456
60490
  if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
60457
60491
  error(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText));
60458
60492
  }
@@ -62654,6 +62688,7 @@ function createTypeChecker(host) {
62654
62688
  }
62655
62689
  function checkExpressionWithTypeArguments(node) {
62656
62690
  checkGrammarExpressionWithTypeArguments(node);
62691
+ forEach(node.typeArguments, checkSourceElement);
62657
62692
  const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
62658
62693
  const typeArguments = node.typeArguments;
62659
62694
  if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
@@ -67981,7 +68016,6 @@ function createTypeChecker(host) {
67981
68016
  let firstDefaultClause;
67982
68017
  let hasDuplicateDefaultClause = false;
67983
68018
  const expressionType = checkExpression(node.expression);
67984
- const expressionIsLiteral = isLiteralType(expressionType);
67985
68019
  forEach(node.caseBlock.clauses, (clause) => {
67986
68020
  if (clause.kind === 293 /* DefaultClause */ && !hasDuplicateDefaultClause) {
67987
68021
  if (firstDefaultClause === void 0) {
@@ -68000,15 +68034,9 @@ function createTypeChecker(host) {
68000
68034
  }
68001
68035
  function createLazyCaseClauseDiagnostics(clause2) {
68002
68036
  return () => {
68003
- let caseType = checkExpression(clause2.expression);
68004
- const caseIsLiteral = isLiteralType(caseType);
68005
- let comparedExpressionType = expressionType;
68006
- if (!caseIsLiteral || !expressionIsLiteral) {
68007
- caseType = caseIsLiteral ? getBaseTypeOfLiteralType(caseType) : caseType;
68008
- comparedExpressionType = getBaseTypeOfLiteralType(expressionType);
68009
- }
68010
- if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) {
68011
- checkTypeComparableTo(caseType, comparedExpressionType, clause2.expression, void 0);
68037
+ const caseType = checkExpression(clause2.expression);
68038
+ if (!isTypeEqualityComparableTo(expressionType, caseType)) {
68039
+ checkTypeComparableTo(caseType, expressionType, clause2.expression, void 0);
68012
68040
  }
68013
68041
  };
68014
68042
  }
@@ -98017,6 +98045,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
98017
98045
  getSymlinkCache,
98018
98046
  realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
98019
98047
  useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
98048
+ getCanonicalFileName,
98020
98049
  getFileIncludeReasons: () => fileReasons,
98021
98050
  structureIsReused,
98022
98051
  writeFile: writeFile2
@@ -98057,7 +98086,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
98057
98086
  const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);
98058
98087
  const containingDir = getDirectoryPath(containingFileName);
98059
98088
  const redirectedReference = getRedirectReferenceForResolution(containingFile);
98060
- const fromCache = moduleResolutionCache.getOrCreateCacheForModuleName(name, mode, redirectedReference).get(containingDir);
98089
+ const fromCache = moduleResolutionCache.getFromNonRelativeNameCache(name, mode, containingDir, redirectedReference);
98061
98090
  if (fromCache)
98062
98091
  addResolutionDiagnostics(fromCache);
98063
98092
  }
@@ -100585,14 +100614,13 @@ var BuilderState;
100585
100614
  const referencedMap = options.module !== 0 /* None */ && !isOutFile ? createManyToManyPathMap() : void 0;
100586
100615
  const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0;
100587
100616
  const useOldState = canReuseOldState(referencedMap, oldState);
100588
- const getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames());
100589
100617
  newProgram.getTypeChecker();
100590
100618
  for (const sourceFile of newProgram.getSourceFiles()) {
100591
100619
  const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
100592
100620
  const oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) == null ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0;
100593
100621
  const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0;
100594
100622
  if (referencedMap) {
100595
- const newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
100623
+ const newReferences = getReferencedFiles(newProgram, sourceFile, newProgram.getCanonicalFileName);
100596
100624
  if (newReferences) {
100597
100625
  referencedMap.set(sourceFile.resolvedPath, newReferences);
100598
100626
  }
@@ -100654,6 +100682,26 @@ var BuilderState;
100654
100682
  (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path);
100655
100683
  }
100656
100684
  BuilderState2.updateSignatureOfFile = updateSignatureOfFile;
100685
+ function computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, onNewSignature) {
100686
+ programOfThisState.emit(
100687
+ sourceFile,
100688
+ (fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
100689
+ Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
100690
+ onNewSignature(computeSignatureWithDiagnostics(
100691
+ programOfThisState,
100692
+ sourceFile,
100693
+ text,
100694
+ host,
100695
+ data
100696
+ ), sourceFiles);
100697
+ },
100698
+ cancellationToken,
100699
+ true,
100700
+ void 0,
100701
+ true
100702
+ );
100703
+ }
100704
+ BuilderState2.computeDtsSignature = computeDtsSignature;
100657
100705
  function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) {
100658
100706
  var _a2;
100659
100707
  if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath))
@@ -100662,26 +100710,12 @@ var BuilderState;
100662
100710
  const prevSignature = info.signature;
100663
100711
  let latestSignature;
100664
100712
  if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
100665
- programOfThisState.emit(
100666
- sourceFile,
100667
- (fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
100668
- Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
100669
- latestSignature = computeSignatureWithDiagnostics(
100670
- programOfThisState,
100671
- sourceFile,
100672
- text,
100673
- host,
100674
- data
100675
- );
100676
- if (latestSignature !== prevSignature) {
100677
- updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
100678
- }
100679
- },
100680
- cancellationToken,
100681
- true,
100682
- void 0,
100683
- true
100684
- );
100713
+ computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, (signature, sourceFiles) => {
100714
+ latestSignature = signature;
100715
+ if (latestSignature !== prevSignature) {
100716
+ updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
100717
+ }
100718
+ });
100685
100719
  }
100686
100720
  if (latestSignature === void 0) {
100687
100721
  latestSignature = sourceFile.version;
@@ -100705,27 +100739,24 @@ var BuilderState;
100705
100739
  if (!state.exportedModulesMap)
100706
100740
  return;
100707
100741
  (state.oldExportedModulesMap || (state.oldExportedModulesMap = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
100708
- if (!exportedModulesFromDeclarationEmit) {
100709
- state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
100710
- return;
100711
- }
100712
- let exportedModules;
100713
- exportedModulesFromDeclarationEmit.forEach((symbol) => addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)));
100742
+ const exportedModules = getExportedModules(exportedModulesFromDeclarationEmit);
100714
100743
  if (exportedModules) {
100715
100744
  state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
100716
100745
  } else {
100717
100746
  state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
100718
100747
  }
100719
- function addExportedModule(exportedModulePaths) {
100720
- if (exportedModulePaths == null ? void 0 : exportedModulePaths.length) {
100721
- if (!exportedModules) {
100722
- exportedModules = /* @__PURE__ */ new Set();
100723
- }
100724
- exportedModulePaths.forEach((path) => exportedModules.add(path));
100725
- }
100726
- }
100727
100748
  }
100728
100749
  BuilderState2.updateExportedModules = updateExportedModules;
100750
+ function getExportedModules(exportedModulesFromDeclarationEmit) {
100751
+ let exportedModules;
100752
+ exportedModulesFromDeclarationEmit == null ? void 0 : exportedModulesFromDeclarationEmit.forEach(
100753
+ (symbol) => getReferencedFilesFromImportedModuleSymbol(symbol).forEach(
100754
+ (path) => (exportedModules != null ? exportedModules : exportedModules = /* @__PURE__ */ new Set()).add(path)
100755
+ )
100756
+ );
100757
+ return exportedModules;
100758
+ }
100759
+ BuilderState2.getExportedModules = getExportedModules;
100729
100760
  function getAllDependencies(state, programOfThisState, sourceFile) {
100730
100761
  const compilerOptions = programOfThisState.getCompilerOptions();
100731
100762
  if (outFile(compilerOptions)) {
@@ -100867,9 +100898,9 @@ function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) {
100867
100898
  function hasSameKeys(map1, map2) {
100868
100899
  return map1 === map2 || map1 !== void 0 && map2 !== void 0 && map1.size === map2.size && !forEachKey(map1, (key) => !map2.has(key));
100869
100900
  }
100870
- function createBuilderProgramState(newProgram, oldState, disableUseFileVersionAsSignature) {
100901
+ function createBuilderProgramState(newProgram, oldState) {
100871
100902
  var _a2, _b;
100872
- const state = BuilderState.create(newProgram, oldState, disableUseFileVersionAsSignature);
100903
+ const state = BuilderState.create(newProgram, oldState, false);
100873
100904
  state.program = newProgram;
100874
100905
  const compilerOptions = newProgram.getCompilerOptions();
100875
100906
  state.compilerOptions = compilerOptions;
@@ -100977,7 +101008,6 @@ function convertToDiagnostics(diagnostics, newProgram) {
100977
101008
  if (!diagnostics.length)
100978
101009
  return emptyArray;
100979
101010
  let buildInfoDirectory;
100980
- let getCanonicalFileName;
100981
101011
  return diagnostics.map((diagnostic) => {
100982
101012
  const result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3);
100983
101013
  result.reportsUnnecessary = diagnostic.reportsUnnecessary;
@@ -100990,7 +101020,7 @@ function convertToDiagnostics(diagnostics, newProgram) {
100990
101020
  });
100991
101021
  function toPath3(path) {
100992
101022
  buildInfoDirectory != null ? buildInfoDirectory : buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
100993
- return toPath(path, buildInfoDirectory, getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames()));
101023
+ return toPath(path, buildInfoDirectory, newProgram.getCanonicalFileName);
100994
101024
  }
100995
101025
  }
100996
101026
  function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) {
@@ -101161,7 +101191,7 @@ function handleDtsMayChangeOf(state, path, cancellationToken, host) {
101161
101191
  sourceFile,
101162
101192
  cancellationToken,
101163
101193
  host,
101164
- !host.disableUseFileVersionAsSignature
101194
+ true
101165
101195
  );
101166
101196
  if (getEmitDeclarations(state.compilerOptions)) {
101167
101197
  addToAffectedFilesPendingEmit(state, path, state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */);
@@ -101288,7 +101318,6 @@ function isProgramBundleEmitBuildInfo(info) {
101288
101318
  function getBuildInfo2(state, bundle) {
101289
101319
  var _a2, _b, _c;
101290
101320
  const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
101291
- const getCanonicalFileName = createGetCanonicalFileName(state.program.useCaseSensitiveFileNames());
101292
101321
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
101293
101322
  const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
101294
101323
  const fileNames = [];
@@ -101406,7 +101435,7 @@ function getBuildInfo2(state, bundle) {
101406
101435
  return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
101407
101436
  }
101408
101437
  function relativeToBuildInfo(path) {
101409
- return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, getCanonicalFileName));
101438
+ return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, state.program.getCanonicalFileName));
101410
101439
  }
101411
101440
  function toFileId(path) {
101412
101441
  let fileId = fileNameToFileId.get(path);
@@ -101509,7 +101538,6 @@ function getTextHandlingSourceMapForSignature(text, data) {
101509
101538
  }
101510
101539
  function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) {
101511
101540
  var _a2, _b;
101512
- let getCanonicalFileName;
101513
101541
  text = getTextHandlingSourceMapForSignature(text, data);
101514
101542
  let sourceFileDirectory;
101515
101543
  if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) {
@@ -101529,7 +101557,7 @@ function computeSignatureWithDiagnostics(program, sourceFile, text, host, data)
101529
101557
  return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
101530
101558
  sourceFileDirectory,
101531
101559
  diagnostic.file.resolvedPath,
101532
- getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames())
101560
+ program.getCanonicalFileName
101533
101561
  ))}(${diagnostic.start},${diagnostic.length})`;
101534
101562
  }
101535
101563
  }
@@ -101544,7 +101572,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
101544
101572
  oldState = void 0;
101545
101573
  return oldProgram;
101546
101574
  }
101547
- const state = createBuilderProgramState(newProgram, oldState, host.disableUseFileVersionAsSignature);
101575
+ const state = createBuilderProgramState(newProgram, oldState);
101548
101576
  newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, bundle);
101549
101577
  newProgram = void 0;
101550
101578
  oldProgram = void 0;
@@ -102003,9 +102031,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
102003
102031
  let filesWithInvalidatedResolutions;
102004
102032
  let filesWithInvalidatedNonRelativeUnresolvedImports;
102005
102033
  const nonRelativeExternalModuleResolutions = createMultiMap();
102006
- const resolutionsWithFailedLookups = [];
102007
- const resolutionsWithOnlyAffectingLocations = [];
102008
- const resolvedFileToResolution = createMultiMap();
102034
+ const resolutionsWithFailedLookups = /* @__PURE__ */ new Set();
102035
+ const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set();
102036
+ const resolvedFileToResolution = /* @__PURE__ */ new Map();
102009
102037
  const impliedFormatPackageJsons = /* @__PURE__ */ new Map();
102010
102038
  let hasChangedAutomaticTypeDirectiveNames = false;
102011
102039
  let affectingPathChecksForFile;
@@ -102078,8 +102106,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
102078
102106
  resolvedModuleNames.clear();
102079
102107
  resolvedTypeReferenceDirectives.clear();
102080
102108
  resolvedFileToResolution.clear();
102081
- resolutionsWithFailedLookups.length = 0;
102082
- resolutionsWithOnlyAffectingLocations.length = 0;
102109
+ resolutionsWithFailedLookups.clear();
102110
+ resolutionsWithOnlyAffectingLocations.clear();
102083
102111
  failedLookupChecks = void 0;
102084
102112
  startsWithPathChecks = void 0;
102085
102113
  isInDirectoryChecks = void 0;
@@ -102396,12 +102424,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
102396
102424
  return fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
102397
102425
  }
102398
102426
  function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
102427
+ var _a2, _b;
102399
102428
  if (resolution.refCount) {
102400
102429
  resolution.refCount++;
102401
102430
  Debug.assertIsDefined(resolution.files);
102402
102431
  } else {
102403
102432
  resolution.refCount = 1;
102404
- Debug.assert(length(resolution.files) === 0);
102433
+ Debug.assert(!((_a2 = resolution.files) == null ? void 0 : _a2.size));
102405
102434
  if (isExternalModuleNameRelative(name)) {
102406
102435
  watchFailedLookupLocationOfResolution(resolution);
102407
102436
  } else {
@@ -102409,10 +102438,14 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
102409
102438
  }
102410
102439
  const resolved = getResolutionWithResolvedFileName(resolution);
102411
102440
  if (resolved && resolved.resolvedFileName) {
102412
- resolvedFileToResolution.add(resolutionHost.toPath(resolved.resolvedFileName), resolution);
102441
+ const key = resolutionHost.toPath(resolved.resolvedFileName);
102442
+ let resolutions = resolvedFileToResolution.get(key);
102443
+ if (!resolutions)
102444
+ resolvedFileToResolution.set(key, resolutions = /* @__PURE__ */ new Set());
102445
+ resolutions.add(resolution);
102413
102446
  }
102414
102447
  }
102415
- (resolution.files || (resolution.files = [])).push(filePath);
102448
+ ((_b = resolution.files) != null ? _b : resolution.files = /* @__PURE__ */ new Set()).add(filePath);
102416
102449
  }
102417
102450
  function watchFailedLookupLocationOfResolution(resolution) {
102418
102451
  Debug.assert(!!resolution.refCount);
@@ -102420,7 +102453,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
102420
102453
  if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length))
102421
102454
  return;
102422
102455
  if (failedLookupLocations == null ? void 0 : failedLookupLocations.length)
102423
- resolutionsWithFailedLookups.push(resolution);
102456
+ resolutionsWithFailedLookups.add(resolution);
102424
102457
  let setAtRoot = false;
102425
102458
  if (failedLookupLocations) {
102426
102459
  for (const failedLookupLocation of failedLookupLocations) {
@@ -102452,7 +102485,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
102452
102485
  if (!(affectingLocations == null ? void 0 : affectingLocations.length))
102453
102486
  return;
102454
102487
  if (addToResolutionsWithOnlyAffectingLocations)
102455
- resolutionsWithOnlyAffectingLocations.push(resolution);
102488
+ resolutionsWithOnlyAffectingLocations.add(resolution);
102456
102489
  for (const affectingLocation of affectingLocations) {
102457
102490
  createFileWatcherOfAffectingLocation(affectingLocation, true);
102458
102491
  }
@@ -102531,17 +102564,20 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
102531
102564
  }
102532
102565
  }
102533
102566
  function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
102534
- unorderedRemoveItem(Debug.checkDefined(resolution.files), filePath);
102567
+ Debug.checkDefined(resolution.files).delete(filePath);
102535
102568
  resolution.refCount--;
102536
102569
  if (resolution.refCount) {
102537
102570
  return;
102538
102571
  }
102539
102572
  const resolved = getResolutionWithResolvedFileName(resolution);
102540
102573
  if (resolved && resolved.resolvedFileName) {
102541
- resolvedFileToResolution.remove(resolutionHost.toPath(resolved.resolvedFileName), resolution);
102574
+ const key = resolutionHost.toPath(resolved.resolvedFileName);
102575
+ const resolutions = resolvedFileToResolution.get(key);
102576
+ if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size)
102577
+ resolvedFileToResolution.delete(key);
102542
102578
  }
102543
102579
  const { failedLookupLocations, affectingLocations } = resolution;
102544
- if (unorderedRemoveItem(resolutionsWithFailedLookups, resolution)) {
102580
+ if (resolutionsWithFailedLookups.delete(resolution)) {
102545
102581
  let removeAtRoot = false;
102546
102582
  for (const failedLookupLocation of failedLookupLocations) {
102547
102583
  const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
@@ -102568,7 +102604,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
102568
102604
  removeDirectoryWatcher(rootPath);
102569
102605
  }
102570
102606
  } else if (affectingLocations == null ? void 0 : affectingLocations.length) {
102571
- unorderedRemoveItem(resolutionsWithOnlyAffectingLocations, resolution);
102607
+ resolutionsWithOnlyAffectingLocations.delete(resolution);
102572
102608
  }
102573
102609
  if (affectingLocations) {
102574
102610
  for (const affectingLocation of affectingLocations) {
@@ -102616,15 +102652,15 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
102616
102652
  if (!resolutions)
102617
102653
  return false;
102618
102654
  let invalidated = false;
102619
- for (const resolution of resolutions) {
102655
+ resolutions.forEach((resolution) => {
102620
102656
  if (resolution.isInvalidated || !canInvalidate(resolution))
102621
- continue;
102657
+ return;
102622
102658
  resolution.isInvalidated = invalidated = true;
102623
102659
  for (const containingFilePath of Debug.checkDefined(resolution.files)) {
102624
102660
  (filesWithInvalidatedResolutions != null ? filesWithInvalidatedResolutions : filesWithInvalidatedResolutions = /* @__PURE__ */ new Set()).add(containingFilePath);
102625
102661
  hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames || endsWith(containingFilePath, inferredTypesContainingFile);
102626
102662
  }
102627
- }
102663
+ });
102628
102664
  return invalidated;
102629
102665
  }
102630
102666
  function invalidateResolutionOfFile(filePath) {
@@ -102919,8 +102955,7 @@ function listFiles(program, write) {
102919
102955
  function explainFiles(program, write) {
102920
102956
  var _a2, _b;
102921
102957
  const reasons = program.getFileIncludeReasons();
102922
- const getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames());
102923
- const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName);
102958
+ const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName);
102924
102959
  for (const file of program.getSourceFiles()) {
102925
102960
  write(`${toFileName(file, relativeFileName)}`);
102926
102961
  (_a2 = reasons.get(file.path)) == null ? void 0 : _a2.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
@@ -102978,10 +103013,9 @@ function getMatchedFileSpec(program, fileName) {
102978
103013
  const configFile = program.getCompilerOptions().configFile;
102979
103014
  if (!((_a2 = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a2.validatedFilesSpec))
102980
103015
  return void 0;
102981
- const getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames());
102982
- const filePath = getCanonicalFileName(fileName);
103016
+ const filePath = program.getCanonicalFileName(fileName);
102983
103017
  const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
102984
- return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
103018
+ return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
102985
103019
  }
102986
103020
  function getMatchedIncludeSpec(program, fileName) {
102987
103021
  var _a2, _b;
@@ -103214,7 +103248,6 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
103214
103248
  getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
103215
103249
  createHash: maybeBind(host, host.createHash),
103216
103250
  readDirectory: maybeBind(host, host.readDirectory),
103217
- disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
103218
103251
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
103219
103252
  };
103220
103253
  return compilerHost;
@@ -103281,7 +103314,6 @@ function createProgramHost(system, createProgram2) {
103281
103314
  writeFile: (path, data, writeByteOrderMark) => system.writeFile(path, data, writeByteOrderMark),
103282
103315
  createHash: maybeBind(system, system.createHash),
103283
103316
  createProgram: createProgram2 || createEmitAndSemanticDiagnosticsBuilderProgram,
103284
- disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
103285
103317
  storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
103286
103318
  now: maybeBind(system, system.now)
103287
103319
  };
@@ -103383,7 +103415,6 @@ function readBuilderProgram(compilerOptions, host) {
103383
103415
  function createIncrementalCompilerHost(options, system = sys) {
103384
103416
  const host = createCompilerHostWorker(options, void 0, system);
103385
103417
  host.createHash = maybeBind(system, system.createHash);
103386
- host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
103387
103418
  host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
103388
103419
  setGetSourceFileAsHashVersioned(host);
103389
103420
  changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName));
@@ -104118,8 +104149,6 @@ function createSolutionBuilderWithWatch(host, rootNames, defaultOptions, baseWat
104118
104149
  function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {
104119
104150
  const host = hostOrHostWithWatch;
104120
104151
  const hostWithWatch = hostOrHostWithWatch;
104121
- const currentDirectory = host.getCurrentDirectory();
104122
- const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
104123
104152
  const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
104124
104153
  const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions);
104125
104154
  setGetSourceFileAsHashVersioned(compilerHost);
@@ -104131,7 +104160,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
104131
104160
  compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache);
104132
104161
  let moduleResolutionCache, typeReferenceDirectiveResolutionCache;
104133
104162
  if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) {
104134
- moduleResolutionCache = createModuleResolutionCache(currentDirectory, getCanonicalFileName);
104163
+ moduleResolutionCache = createModuleResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName);
104135
104164
  compilerHost.resolveModuleNameLiterals = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
104136
104165
  moduleNames,
104137
104166
  containingFile,
@@ -104145,7 +104174,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
104145
104174
  compilerHost.getModuleResolutionCache = () => moduleResolutionCache;
104146
104175
  }
104147
104176
  if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) {
104148
- typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
104177
+ typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
104149
104178
  compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
104150
104179
  typeDirectiveNames,
104151
104180
  containingFile,
@@ -104162,8 +104191,6 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
104162
104191
  const state = {
104163
104192
  host,
104164
104193
  hostWithWatch,
104165
- currentDirectory,
104166
- getCanonicalFileName,
104167
104194
  parseConfigFileHost: parseConfigHostFromCompilerHostLike(host),
104168
104195
  write: maybeBind(host, host.trace),
104169
104196
  options,
@@ -104207,7 +104234,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
104207
104234
  return state;
104208
104235
  }
104209
104236
  function toPath2(state, fileName) {
104210
- return toPath(fileName, state.currentDirectory, state.getCanonicalFileName);
104237
+ return toPath(fileName, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
104211
104238
  }
104212
104239
  function toResolvedConfigFilePath(state, fileName) {
104213
104240
  const { resolvedConfigFilePaths } = state;
@@ -104250,7 +104277,7 @@ function parseConfigFile(state, configFileName, configFilePath) {
104250
104277
  return parsed;
104251
104278
  }
104252
104279
  function resolveProjectName(state, name) {
104253
- return resolveConfigFileProjectName(resolvePath(state.currentDirectory, name));
104280
+ return resolveConfigFileProjectName(resolvePath(state.compilerHost.getCurrentDirectory(), name));
104254
104281
  }
104255
104282
  function createBuildOrder(state, roots) {
104256
104283
  const temporaryMarks = /* @__PURE__ */ new Map();
@@ -104453,7 +104480,7 @@ function createUpdateOutputFileStampsProject(state, project, projectPath, config
104453
104480
  projectPath,
104454
104481
  buildOrder,
104455
104482
  getCompilerOptions: () => config.options,
104456
- getCurrentDirectory: () => state.currentDirectory,
104483
+ getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
104457
104484
  updateOutputFileStatmps: () => {
104458
104485
  updateOutputTimestamps(state, config, projectPath);
104459
104486
  updateOutputFileStampsPending = false;
@@ -104478,7 +104505,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
104478
104505
  projectPath,
104479
104506
  buildOrder,
104480
104507
  getCompilerOptions: () => config.options,
104481
- getCurrentDirectory: () => state.currentDirectory,
104508
+ getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
104482
104509
  getBuilderProgram: () => withProgramOrUndefined(identity),
104483
104510
  getProgram: () => withProgramOrUndefined(
104484
104511
  (program2) => program2.getProgramOrUndefined()
@@ -104534,7 +104561,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
104534
104561
  projectPath,
104535
104562
  buildOrder,
104536
104563
  getCompilerOptions: () => config.options,
104537
- getCurrentDirectory: () => state.currentDirectory,
104564
+ getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
104538
104565
  emit: (writeFile2, customTransformers) => {
104539
104566
  if (step !== 4 /* EmitBundle */)
104540
104567
  return invalidatedProjectOfBundle;
@@ -105641,7 +105668,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
105641
105668
  fileOrDirectory,
105642
105669
  fileOrDirectoryPath: toPath2(state, fileOrDirectory),
105643
105670
  configFileName: resolved,
105644
- currentDirectory: state.currentDirectory,
105671
+ currentDirectory: state.compilerHost.getCurrentDirectory(),
105645
105672
  options: parsed.options,
105646
105673
  program: state.builderPrograms.get(resolvedPath) || ((_a2 = getCachedParsedConfigFile(state, resolvedPath)) == null ? void 0 : _a2.fileNames),
105647
105674
  useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames,
@@ -105746,7 +105773,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
105746
105773
  };
105747
105774
  }
105748
105775
  function relName(state, path) {
105749
- return convertToRelativePath(path, state.currentDirectory, (f) => state.getCanonicalFileName(f));
105776
+ return convertToRelativePath(path, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
105750
105777
  }
105751
105778
  function reportStatus(state, message, ...args) {
105752
105779
  state.host.reportSolutionBuilderStatus(createCompilerDiagnostic(message, ...args));