Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(compiler): only report parser errors on invalid expression #61793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

Currently we reuse the same binding parser for all expressions in the template. Under the hood, the parser has a single errors array that it passes into all ASTs which means that if there's one binding with an error, those errors will be propagated to all other ASTs in the template.

These changes switch to having a unique errors array for each AST so we only report errors once.

Relates to #61792.

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels May 31, 2025
@angular-robot angular-robot bot added the area: compiler Issues related to `ngc`, Angular's template compiler label May 31, 2025
@ngbot ngbot bot added this to the Backlog milestone May 31, 2025
@crisbeto crisbeto marked this pull request as ready for review May 31, 2025 09:05
@crisbeto crisbeto requested a review from AndrewKushnir May 31, 2025 09:08
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crisbeto thanks for the fix!

Currently we reuse the same binding parser for all expressions in the template. Under the hood, the parser has a single `errors` array that it passes into all ASTs which means that if there's one binding with an error, those errors will be propagated to all other ASTs in the template.

These changes switch to having a unique `errors` array for each AST so we only report errors once.

Relates to angular#61792.
@crisbeto crisbeto force-pushed the 61792/parser-duplicates branch from 067690c to 10d0bee Compare May 31, 2025 16:32
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels May 31, 2025
@cyber-hari
Copy link

LGTM!

@kirjs
Copy link
Contributor

kirjs commented Jun 2, 2025

This PR was merged into the repository by commit 5a76826.

The changes were merged into the following branches: main

@kirjs kirjs closed this in 5a76826 Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants