You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No
Description
Having a parenthesized assignment to an array member inside a two-way ngModel binding will not report a compile-time error, but produce a "JavaScript heap out of memory" error during ng build and ng serve. Removing the parentheses will still not cause a compile-time error and will work as expected at runtime.
Having an assignment in a two-way binding is wrong. But, I have an enterprise app (big ball of mud), whose build started failing after prettier reformatted the codebase. There was no compiler error, nor warning, just the error below. I traced it to a few lines in a template file, where prettier added parentheses.
The app is on Angular 12.2.16, but the issue is reproducible with my example on 14.0.7 as well. When ran on StackBlitz, it would crash the browser tab with an 'out of memory' error.
Please provide a link to a minimal reproduction of the bug
…alid left-hand expression
In angular#39004 some logic was introduced that tries to recover invalid expressions by treating the `=` token as a recovery point. It works by skipping ahead to the next recovery point inside the `skip` method which is called whenever an error is reported. This can lead to an infinite loop inside the `parseChain` method which assumes that reporting an error would've skipped over the token, but that won't happen since the `=` token is a recovery point. These changes resolve the infinite loop by breaking the loop if `error` didn't skip to a different token after the error was reported.
Fixesangular#47131.
…alid left-hand expression (#47151)
In #39004 some logic was introduced that tries to recover invalid expressions by treating the `=` token as a recovery point. It works by skipping ahead to the next recovery point inside the `skip` method which is called whenever an error is reported. This can lead to an infinite loop inside the `parseChain` method which assumes that reporting an error would've skipped over the token, but that won't happen since the `=` token is a recovery point. These changes resolve the infinite loop by breaking the loop if `error` didn't skip to a different token after the error was reported.
Fixes#47131.
PR Close#47151
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No
Description
Having a parenthesized assignment to an array member inside a two-way
ngModel
binding will not report a compile-time error, but produce a "JavaScript heap out of memory" error duringng build
andng serve
. Removing the parentheses will still not cause a compile-time error and will work as expected at runtime.Having an assignment in a two-way binding is wrong. But, I have an enterprise app (big ball of mud), whose build started failing after prettier reformatted the codebase. There was no compiler error, nor warning, just the error below. I traced it to a few lines in a template file, where prettier added parentheses.
The app is on Angular 12.2.16, but the issue is reproducible with my example on 14.0.7 as well. When ran on StackBlitz, it would crash the browser tab with an 'out of memory' error.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-ivy-wgogh2?file=src/app/app.component.ts
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
Providing repro snippet in case StackBlitz link expires:
The following code will compile and run fine:
The text was updated successfully, but these errors were encountered: