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

destruct-param conflicts with variables introduced by itself #200

Open
nene opened this issue Dec 14, 2016 · 0 comments
Open

destruct-param conflicts with variables introduced by itself #200

nene opened this issue Dec 14, 2016 · 0 comments
Labels

Comments

@nene
Copy link
Collaborator

nene commented Dec 14, 2016

When transforming a function with two objects that have the same field:

function fn(a, b) {
  console.log(a.foo, b.foo);
}

Lebab produces the following:

function fn({foo}, {foo}) {
  console.log(foo, foo);
}

The same problem happens when there's an inner function that has object parameter with the same field:

function fn(a) {
  function inner(b) {
    console.log(a.foo, b.foo);
  }
}

Again Lebab produces:

function fn({foo}) {
  function inner({foo}) {
    console.log(foo, foo);
  }
}

destructParamTest.js contains skipped tests for these scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant