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

Labels should be minified #468

Open
ooflorent opened this issue Mar 8, 2017 · 2 comments
Open

Labels should be minified #468

ooflorent opened this issue Mar 8, 2017 · 2 comments
Projects

Comments

@ooflorent
Copy link

Currently labels are not minified:

Input:

abc: for (var a = [1, 2, 3, 4], i = 0; i < a.length; ++i) {
  continue abc
}
def: for (var a = [1, 2, 3, 4], i = 0; i < a.length; ++i) {
  for (var j = i; j < a.length; ++j) {
    if (i + j > 7) {
      continue def
    }
  }
}

Current output:

abc:for(var a=[1,2,3,4],i=0;i<a.length;++i)continue abc;
def:for(var a=[1,2,3,4],i=0;i<a.length;++i)for(var j=i;j<a.length;++j)if(7<i+j)continue def;

Expected output:

for(var a=[1,2,3,4],i=0;i<a.length;++i)continue;
a:for(var a=[1,2,3,4],i=0;i<a.length;++i)for(var j=i;j<a.length;++j)if(7<i+j)continue a;
@hzoo
Copy link
Member

hzoo commented Mar 8, 2017

Hey @ooflorent! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@boopathi
Copy link
Member

boopathi commented Mar 9, 2017

We are explicitly NOT mangling labels and one of the reasons was babel had labels and variables as bindings and these label bindings were interfering with other variables in the scope. This has changed in babel in babel/babel#4758. Should revisit that in mangler.

@boopathi boopathi added this to Mangler feature requests in Mangler Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Mangler
Mangler feature requests
Development

No branches or pull requests

3 participants