angular/packages/compiler/test/expression_parser
Kristiyan Kostadinov fd5a04927e fix(compiler): recover invalid parenthesized expressions (#61815)
When the expression parser consumes tokens inside a parenthesized expression, it looks for valid tokens until it hits and invalid one or a closing paren. If it finds an invalid token, it reports and error and tries to recover until it finds a closing paren. The problem is that in such cases, it would produce the `ParenthesizedExpression` and continue parsing **from** from the closing paren which would then produce more errors that add noise to the output and result in an incorrect representation of the user's code. E.g. `foo((event.target as HTMLElement).value)` would be recovered to `foo((event.target)).value` instead of `foo((event.target).value)`.

These changes resolve the issue by skipping over the closing paren at the recovery point.

Fixes #61792.

PR Close #61815
2025-06-02 15:50:46 -04:00
..
utils build: migrate packages/compiler to ts_project (#61566) 2025-05-29 14:39:10 -04:00
ast_spec.ts refactor(compiler): convert scripts within packages/compiler to relative imports (#60625) 2025-04-01 11:57:53 +00:00
BUILD.bazel build: migrate packages/compiler to ts_project (#61566) 2025-05-29 14:39:10 -04:00
lexer_spec.ts fix(compiler): lexer support for template literals in object literals (#61601) 2025-05-26 10:24:16 +00:00
parser_spec.ts fix(compiler): recover invalid parenthesized expressions (#61815) 2025-06-02 15:50:46 -04:00
serializer_spec.ts feat(compiler): support the in keyword in Binary expression (#58432) 2025-04-22 21:44:12 +02:00