Skip to content

Commit 50153bc

Browse files
committed
Remove readonly annotation and comment instead
1 parent 77d0144 commit 50153bc

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/compiler/moduleNameResolver.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ export interface ModuleResolutionState {
316316
host: ModuleResolutionHost;
317317
compilerOptions: CompilerOptions;
318318
traceEnabled: boolean;
319-
readonly failedLookupLocations: string[] | undefined;
320-
readonly affectingLocations: string[] | undefined;
319+
failedLookupLocations: string[] | undefined;
320+
affectingLocations: string[] | undefined;
321321
resultFromCache?: ResolvedModuleWithFailedLookupLocations;
322322
packageJsonInfoCache: PackageJsonInfoCache | undefined;
323323
features: NodeResolutionFeatures;
@@ -2756,6 +2756,9 @@ function getLoadModuleFromTargetExportOrImport(extensions: Extensions, state: Mo
27562756
traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup);
27572757
traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/");
27582758
const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, extensions, /*isConfigLookup*/ false, redirectedReference, state.conditions);
2759+
// Note: we cannot safely reassign `state.failedLookupLocations` during a request;
2760+
// `nodeModuleNameResolverWorker` relies on the `state` property remaining reference-equal
2761+
// to the one it initializes.
27592762
state.failedLookupLocations?.push(...result.failedLookupLocations ?? emptyArray);
27602763
state.affectingLocations?.push(...result.affectingLocations ?? emptyArray);
27612764
return toSearchResult(

0 commit comments

Comments
 (0)