Skip to content

Please stop skipping the method name #26658

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

Closed
vdakalov opened this issue Aug 24, 2018 · 1 comment
Closed

Please stop skipping the method name #26658

vdakalov opened this issue Aug 24, 2018 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@vdakalov
Copy link

Why you translate static and instance methods, defined as

class Base {
  static foo() {}
  bar() {}
}

in to

// ...
Base.foo = function () { };
Base.prototype.bar = function () { };
// ...

You loses information about function name. Please translate method with

// ...
Base.foo = function foo() { };
Base.prototype.bar = function bar() { };
// ...
@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Aug 24, 2018
@RyanCavanaugh
Copy link
Member

We do this as to not break your code, as the identifier foo inside the method body refers to a possible outer foo, not the function itself.

See #5611 for the runtime value of .name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants