From 3f70aba2722805b979984874248fa060e704d3e9 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sat, 10 Mar 2018 10:10:11 -0800 Subject: [PATCH] fix(compiler-cli): disableTypeScriptVersionCheck should be applied even for older tsc versions (#22669) Previously the flag would only disable the check in the case we tried to use newer tsc version. In g3 we sometimes take a while to update tsc, but as a prerequisite of that Angular needs to be updated first. This change enables us to update Angular and use it in g3 while g3 is being update to the required tsc. Of course extra care is required when this check is disabled, but since we control everything in g3, it's on us to get this right. I don't see any preexisting tests for this, and I'm not sure how to write them right now. I filed https://github.com/angular/angular/issues/22699 PR Close #22669 --- packages/compiler-cli/src/transformers/program.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-cli/src/transformers/program.ts b/packages/compiler-cli/src/transformers/program.ts index 5f25218013..0b045509b6 100644 --- a/packages/compiler-cli/src/transformers/program.ts +++ b/packages/compiler-cli/src/transformers/program.ts @@ -73,7 +73,7 @@ class AngularCompilerProgram implements Program { private host: CompilerHost, oldProgram?: Program) { this.rootNames = [...rootNames]; - if (ts.version < '2.7.2' || (ts.version >= '2.8.0' && !options.disableTypeScriptVersionCheck)) { + if ((ts.version < '2.7.2' || ts.version >= '2.8.0') && !options.disableTypeScriptVersionCheck) { throw new Error( `The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but ${ts.version} was found instead.`); }