-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fixed loose option of transform-es2015-parameters handling only Assig… #6274
Fixed loose option of transform-es2015-parameters handling only Assig… #6274
Conversation
@Andarist awesome! was just looking into this :) |
hah, thats the reason why I was poking around about babel-preset-env on the slack ;) |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/4987/ |
|
||
for (let i = 0; i < params.length; i++) { | ||
const param = params[i]; | ||
|
||
if (param.isAssignmentPattern()) { | ||
if (param.isAssignmentPattern() && loose) { |
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.
Worth merging this with the next block that also wants isAssignmentPattern/left/right?
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.
well, i though about merging those 2 conditions, just couldnt stand the level of indentation it would have created ;) ive also wanted to extract it to some function for the readability but those blocks need access to just too many variables available in the scope
if you prefer I merge them just let me know and I'll amend my PR
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.
Yeah, had the same reservations re: nesting lol, it's fine.
…nmentPatterns
Fixed issue with introduced to
transform-es2015-parameters
"loose" mode. It was handling only the AssignmentPatterns, so other parameters type introduced in es2015 like ObjectPatterns were not transformed at all.