-
Notifications
You must be signed in to change notification settings - Fork 25.9k
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
refactor(compiler): remove empty string suffix from interpolati… #60066
base: main
Are you sure you want to change the base?
refactor(compiler): remove empty string suffix from interpolati… #60066
Conversation
a7c58e1 to
536b79a
Compare
c7a385e to
29cdcb6
Compare
| if (interpolationParts.length > 0) { | ||
| // This handles potential undefined last suffix in the interpolationParts array. | ||
| if (interpolationParts[interpolationParts.length - 1] === undefined) { | ||
| interpolationParts.pop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to mutate the array instead of skipping the last value when reading it instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next line is a interpolationParts.join()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we handle this at the call site by doing something like suffix || ''?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you prefer that we can go that road. It's 16 callsites but they are guarded by ngDevMode.
29cdcb6 to
5615563
Compare
5615563 to
1058c78
Compare
…on instructions With this change, interpolations that don't have a suffix will miss the last argument which was previously an empty string.
1058c78 to
9c99e9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on build infra (APF is already shipping ES2022; so it makes sense)


…on instructions
With this change, interpolations that don't have a suffix will miss the last argument which was previously an empty string.