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

Incorrect local name w/ native classes & babel-minify #83

Open
developit opened this issue Jan 4, 2019 · 0 comments
Open

Incorrect local name w/ native classes & babel-minify #83

developit opened this issue Jan 4, 2019 · 0 comments

Comments

@developit
Copy link

developit commented Jan 4, 2019

Looks like the local name gets mangled with babel-minify, but not references to it.

  • This only happens when classes are not transpiled (eg: no preset, or env preset with >4%) and minify is used.
  • Changing to an expression (const Foo = @hello class {}) works, though the name is not mangled
  • The effect is still present when no decorator is used.

It seems like the outer variable name assigned by the decorators plugin is being mangled when it shouldn't be (since without the decorator it is unmangled).

Input Output
@hello
class Foo {};
new Foo();
var _class;
let a = hello(_class = class Foo {}) || _class;
new Foo();

Babel REPL Link

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

1 participant