Skip to content

Commit 7234824

Browse files
alxhubAndrewKushnir
authored andcommitted
fix(compiler-cli): fix broken version detection condition (#54443)
The version detection condition for signal two-way bindings used an OR instead of an AND, resulting in every `.0` patch version being considered as supporting two-way bindings to signals. This commit fixes the logic and adds additional parentheses to ensure the meaning of the condition is more clear. Long term, we should switch to semver version parsing instead. PR Close #54443
1 parent 0b95d14 commit 7234824

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/compiler-cli/src/ngtsc/core/src/compiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,8 @@ export class NgCompiler {
799799
// two-way bindings. We also allow version 0.0.0 in case somebody is using Angular at head.
800800
const allowSignalsInTwoWayBindings = this.angularCoreVersion === null ||
801801
this.angularCoreVersion.major > 17 ||
802-
this.angularCoreVersion.major === 17 && this.angularCoreVersion.minor >= 2 ||
803-
(this.angularCoreVersion.major === 0 && this.angularCoreVersion.minor === 0 ||
802+
(this.angularCoreVersion.major === 17 && this.angularCoreVersion.minor >= 2) ||
803+
(this.angularCoreVersion.major === 0 && this.angularCoreVersion.minor === 0 &&
804804
this.angularCoreVersion.patch === 0);
805805

806806
// First select a type-checking configuration, based on whether full template type-checking is

0 commit comments

Comments
 (0)