Skip to content

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Jun 16, 2025

Q                       A
Fixed Issues? Fixes #17384
Patch: Bug Fix? Yes
Major: Breaking Change? Yes
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#3103
Any Dependency Changes?
License MIT

In this pull request we remove AssignmentPattern and RestElement from the LVal alias, since they must be nested within a pattern or a function parameter, rather than being allowed to be the LHS of an assignment. The typing usage in the codebase is also updated: we broaden the previous t.LVal with t.PatternLike such that it covers those two elements as well.

@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release PR: Needs Docs labels Jun 16, 2025
@babel-bot
Copy link
Collaborator

babel-bot commented Jun 16, 2025

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/59583

@JLHwung JLHwung force-pushed the fix-incorrect-lhs-coverage branch from 3c116c5 to 71c0d33 Compare June 16, 2025 17:27
@JLHwung
Copy link
Contributor Author

JLHwung commented Jun 17, 2025

Docs PR is ready, ptal: babel/website#3103

@JLHwung JLHwung merged commit b0a7723 into babel:main Jun 18, 2025
58 checks passed
@JLHwung JLHwung deleted the fix-incorrect-lhs-coverage branch June 18, 2025 12:38

function flattenLVal(
path: NodePath<t.LVal | t.OptionalMemberExpression>,
path: NodePath<t.LVal | t.PatternLike | t.OptionalMemberExpression>,
Copy link
Member

Choose a reason for hiding this comment

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

OptionalMemberExpression should probably be also an LVal itself just like MemberExpression is, rather than listing it separately?

Copy link
Contributor Author

@JLHwung JLHwung Jun 18, 2025

Choose a reason for hiding this comment

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

Yes. That will be a new feature and thus be handled in a new PR. (Breaking changes can be merged directly as long as it's behind the BABEL_8_BREAKING flag but features has to be waited for the next release).

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 18, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LHS nodes are defined incorrectly in Babel 8

5 participants