Navigation Menu

Skip to content
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

Fix: default rest argument array elements as undefined #14032

Merged
merged 5 commits into from Dec 13, 2021

Conversation

The-x-Theorist
Copy link
Contributor

@The-x-Theorist The-x-Theorist commented Dec 7, 2021

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

Default rest argument array elements won't be undefined anymore, It will give the correct output as required from the arguments with rest, Because now we first memoize the arguments and then bind the arguments to some other array.

@babel-bot
Copy link
Collaborator

babel-bot commented Dec 7, 2021

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

@nicolo-ribaudo nicolo-ribaudo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Dec 7, 2021
nicolo-ribaudo
nicolo-ribaudo previously approved these changes Dec 10, 2021
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

Thanks!

@lightmare
Copy link
Contributor

IMO this should not change any of the existing fixtures that don't name their rest element ...arguments

@nicolo-ribaudo nicolo-ribaudo dismissed their stale review December 10, 2021 11:24

Actually, could you call path.scope.rename("arguments") if the rest binding is arguments, rather than updating the template? (#13992 (comment))

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

This should not be released before #14036, since until #14036 is merged renaming arguents is not fully working.

@nicolo-ribaudo nicolo-ribaudo merged commit a7acde3 into babel:main Dec 13, 2021
@The-x-Theorist The-x-Theorist deleted the rest-parameters-bug branch December 14, 2021 05:39
@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 Mar 16, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2022
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: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: The Extension Operator in the Function Argument Failed to Resolve
5 participants