refactor(compiler): remove TypeScript 4.0 program reuse check (#41406)

We no longer support TS 4.0, hence this check is redundant.

PR Close #41406
This commit is contained in:
Alan Agius 2021-04-01 10:35:27 +02:00 committed by atscott
parent 64b979e12b
commit dc655262be
1 changed files with 1 additions and 4 deletions

View File

@ -668,10 +668,7 @@ class AngularCompilerProgram implements Program {
// - we cache all the files in the hostAdapter
// - new new stubs use the exactly same imports/exports as the old once (we assert that in
// hostAdapter.updateGeneratedFile).
// TS 4.1+ stores the reuse state in the new program
const checkReuseProgram =
(ts.versionMajorMinor as string) === '4.0' ? tmpProgram : this._tsProgram;
if (tsStructureIsReused(checkReuseProgram) !== StructureIsReused.Completely) {
if (tsStructureIsReused(this._tsProgram) !== StructureIsReused.Completely) {
throw new Error(`Internal Error: The structure of the program changed during codegen.`);
}
}