Skip to content

Commit eeea32b

Browse files
sheetalkamatDanielRosenwasser
authored andcommitted
Handle the fact that noResolveResolution resolution is reused
Fixes microsoft#39795
1 parent 1763b8e commit eeea32b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/compiler/resolutionCache.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ namespace ts {
406406
perDirectoryResolution.set(name, resolution);
407407
}
408408
resolutionsInFile.set(name, resolution);
409-
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, noResolveResolution);
409+
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
410410
if (existingResolution) {
411411
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
412412
}
@@ -561,15 +561,14 @@ namespace ts {
561561
resolution: T,
562562
filePath: Path,
563563
getResolutionWithResolvedFileName: GetResolutionWithResolvedFileName<T, R>,
564-
noResolveResolution: T
565564
) {
566565
if (resolution.refCount) {
567566
resolution.refCount++;
568567
Debug.assertDefined(resolution.files);
569568
}
570569
else {
571570
resolution.refCount = 1;
572-
Debug.assert(resolution.files === undefined || (resolution === noResolveResolution && length(noResolveResolution.files) === 0));
571+
Debug.assert(length(resolution.files) === 0); // This resolution shouldnt be referenced by any file yet
573572
if (isExternalModuleNameRelative(name)) {
574573
watchFailedLookupLocationOfResolution(resolution);
575574
}

0 commit comments

Comments
 (0)