Skip to content

Support use of this keyword in static ES6 methods #2397

@ChadKillingsworth

Description

@ChadKillingsworth

It's very common (and safe) to use the this keyword in a static member definition:

class Foo {
  static get baz() { return 'baz'; }

  static bar() {
    console.log(this.baz);
  }
}

We should replace the this keyword with a reference to the class name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions