Skip to content

Static method arrow function does not name anonymous function #7425

@reggi

Description

@reggi

I'd expect M.blue.name to be blue, but for some reason arrow functions don't have a name. Is this a bug or intentional?

class M {
static green () { return 'green' }
static blue = () => 'green'
}
module.exports = M
var M = function () {
  function M() {
    _classCallCheck(this, M);
  }

  _createClass(M, null, [{
    key: 'green',
    value: function green() {
      return 'green';
    }
  }]);

  return M;
}();

M.blue = function () {
    'green'
};

Guess I'd love it to be like this instead:

M.blue = function blue () {
    'green'
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions