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

Fixed loose option of transform-es2015-parameters handling only Assig… #6274

Merged

Conversation

Andarist
Copy link
Member

…nmentPatterns

Q                       A
Fixed Issues n/a
Patch: Bug Fix? yes
Major: Breaking Change? no
Minor: New Feature? no
Tests Added/Pass? yes
Spec Compliancy? n/a
License MIT
Doc PR no
Any Dependency Changes? no

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.

@existentialism existentialism added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Sep 19, 2017
@existentialism
Copy link
Member

existentialism commented Sep 19, 2017

@Andarist awesome! was just looking into this :)

@Andarist
Copy link
Member Author

Andarist commented Sep 19, 2017

hah, thats the reason why I was poking around about babel-preset-env on the slack ;)

@babel-bot
Copy link
Collaborator

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) {
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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.

@jridgewell jridgewell merged commit d8b7bc3 into babel:master Sep 22, 2017
@Andarist Andarist deleted the fix/transform-es2015-parameters-loose branch September 22, 2017 23:46
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
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.

None yet

4 participants