Remove an unneeded parameter from CompilerHost constructor.
BREAKING CHANGE:
If you use the internal API of tsc_wrapped you need to update the CompilerHost constructor calls.
PiperOrigin-RevId: 221634093
diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts
index 3f7390d..86115ba 100644
--- a/internal/tsc_wrapped/compiler_host.ts
+++ b/internal/tsc_wrapped/compiler_host.ts
@@ -83,13 +83,13 @@
provideExternalModuleDtsNamespace: boolean;
options: BazelTsOptions;
host: ts.ModuleResolutionHost = this;
+ private allowActionInputReads = true;
constructor(
public inputFiles: string[], options: ts.CompilerOptions,
readonly bazelOpts: BazelOptions, private delegate: ts.CompilerHost,
private fileLoader: FileLoader,
- private readonly allowActionInputReads: boolean,
private moduleResolver: ModuleResolver = ts.resolveModuleName) {
this.options = narrowTsOptions(options);
this.relativeRoots =
@@ -110,8 +110,7 @@
// include global typings from node_modules/@types
// see getAutomaticTypeDirectiveNames in
// TypeScript:src/compiler/moduleNameResolver
- // Do this for Bazel only - under Blaze we don't support such discovery.
- if (allowActionInputReads && delegate && delegate.directoryExists) {
+ if (this.allowActionInputReads && delegate && delegate.directoryExists) {
this.directoryExists = delegate.directoryExists.bind(delegate);
}
diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts
index b430874..768127e 100644
--- a/internal/tsc_wrapped/tsc_wrapped.ts
+++ b/internal/tsc_wrapped/tsc_wrapped.ts
@@ -188,10 +188,8 @@
const compilerHostDelegate =
ts.createCompilerHost({target: ts.ScriptTarget.ES5});
- const allowActionInputReads = true;
const compilerHost = new CompilerHost(
- files, options, bazelOpts, compilerHostDelegate, fileLoader,
- allowActionInputReads);
+ files, options, bazelOpts, compilerHostDelegate, fileLoader);
const oldProgram = cache.getProgram(bazelOpts.target);