diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 20e7101fcd8..7afa7eb9730 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -451,7 +451,7 @@ namespace ts { let readFileWithCache = (f: string) => host.readFile(f); let projectCompilerOptions = baseCompilerOptions; const compilerHost = createCompilerHostFromProgramHost(host, () => projectCompilerOptions); - setCreateSourceFileAsHashVersioned(compilerHost, host); + setGetSourceFileAsHashVersioned(compilerHost, host); const buildInfoChecked = createFileMap(toPath); diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index c01174f685b..1ad73c19382 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -275,7 +275,7 @@ namespace ts { } } - export function setCreateSourceFileAsHashVersioned(compilerHost: CompilerHost, host: ProgramHost) { + export function setGetSourceFileAsHashVersioned(compilerHost: CompilerHost, host: ProgramHost) { const originalGetSourceFile = compilerHost.getSourceFile; const computeHash = host.createHash || generateDjb2Hash; compilerHost.getSourceFile = (...args) => { @@ -619,7 +619,7 @@ namespace ts { } const compilerHost = createCompilerHostFromProgramHost(host, () => compilerOptions, directoryStructureHost) as CompilerHost & ResolutionCacheHost; - setCreateSourceFileAsHashVersioned(compilerHost, host); + setGetSourceFileAsHashVersioned(compilerHost, host); // Members for CompilerHost const getNewSourceFile = compilerHost.getSourceFile; compilerHost.getSourceFile = (fileName, ...args) => getVersionedSourceFileByPath(fileName, toPath(fileName), ...args);