Skip to content

inferred unused function names are not removed #843

@boopathi

Description

@boopathi

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions