destruct-param conflicts with variables introduced by itself #200

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

Projects

None yet

1 participant

@nene
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.

@nene nene added the bug label Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment