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

Minifies class name and function variables to be the same variable name #161

Closed
MarshallOfSound opened this issue Sep 16, 2016 · 4 comments

Comments

@MarshallOfSound
Copy link

Reproduction Code:

class Foo {
  doThing() {

  }
}

thing.on('_', (something, anotherThing) => {
  const b = new Foo(anotherThing, something.sender);
}); 

Results in:

class a{
  doThing(){}
}

thing.on('_', (a, c) => {
  new a(c, a.sender)
});

This can be seen here

Basically something and Foo both minify to be a even though they are both accessible in the same scope. I have no idea what is causing this but it is throwing all sorts of errors and issues in minified code 👍

@goto-bus-stop
Copy link
Contributor

I think this is the same bug as #147, which is fixed on master:

➜  babili git:(master) ✗ cat test-161.js
class Foo {
  doThing() {

  }
}

thing.on('_', (something, anotherThing) => {
  const b = new Foo(anotherThing, something.sender);
});

➜  babili git:(master) ✗ ./packages/babili/bin/babili.js test-161.js
class Foo{doThing(){}}thing.on('_',(a,c)=>{new Foo(c,a.sender)});

@MarshallOfSound
Copy link
Author

@goto-bus-stop Scanned the open issues, wasn't expecting it to be on the closed pile 👍

I'll just check latest master and close if the issue is fixed 😄

@boopathi
Copy link
Member

Thanks!. This is already fixed by #140 and is merged to master.

@MarshallOfSound
Copy link
Author

@boopathi Is there any way we can get a patch bump for this, it's a pretty significant blocker at the moment

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

No branches or pull requests

3 participants