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

Fixes setter paratemer default value #8479

Merged
merged 2 commits into from Aug 16, 2018
Merged

Fixes setter paratemer default value #8479

merged 2 commits into from Aug 16, 2018

Conversation

nikolayemrikh
Copy link
Contributor

@nikolayemrikh nikolayemrikh commented Aug 15, 2018

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

Forces setter's default parameter to use loose transform

@babel-bot
Copy link
Collaborator

babel-bot commented Aug 15, 2018

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

@@ -60,7 +60,8 @@ export default function convertFunctionParams(path, loose) {
for (let i = 0; i < params.length; i++) {
const param = params[i];

if (param.isAssignmentPattern() && loose) {
const paramIsAssignmentPattern = param.isAssignmentPattern();
if (paramIsAssignmentPattern && loose) {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of setting loose to true for setters, could you update this check to (loose || node.kind === "set")?
It would be a little more descriptive and, if we use loose for other parts of the transform on the future, they won't be automatically enabled for setters since they might not be needed.

Copy link
Member

Choose a reason for hiding this comment

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

Yep I was thinking that as well!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the beginning i did so. But later..

@existentialism existentialism added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Aug 15, 2018
@jridgewell jridgewell merged commit 5043ec7 into babel:master Aug 16, 2018
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 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.

Setter default value
6 participants