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

inferred unused function names are not removed #843

Open
boopathi opened this issue May 14, 2018 · 0 comments
Open

inferred unused function names are not removed #843

boopathi opened this issue May 14, 2018 · 0 comments

Comments

@boopathi
Copy link
Member

Describe the bug

Follow up of #842 -

Function names created by function name transformer of es2015 aren't removed when unused.

To Reproduce

Minimal code to reproduce the bug

function foo() {
  return {
    a() {}
  }
}

Actual Output

If there is no Error thrown,

function foo() {
  return {
    a: function b() {}
  };
}

Expected Output

function foo() {
  return {
    a: function() {}
  };
}

Configuration

babel-minify-cli

babel-minify version: master after #841

babel version : 7.0.0-beta.46

babel-minify-config:

{
  removeConsole: true,
  keepFnNames: true
}

babelrc:

{
  plugins: [],
  presets: []
}

Possible solution

Apply the same fix as in #842 - force register the binding (because this binding has been skipped by babel)

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

No branches or pull requests

1 participant