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
Fix: default rest argument array elements as undefined #14032
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/50291/ |
packages/babel-plugin-transform-parameters/test/fixtures/parameters/default-arguments/exec.js
Show resolved
Hide resolved
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.
Thanks!
IMO this should not change any of the existing fixtures that don't name their rest element |
Actually, could you call path.scope.rename("arguments")
if the rest binding is arguments
, rather than updating the template? (#13992 (comment))
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.
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.