google / google/closure-compiler
Support use of `this` keyword in static ES6 methods
Open
ES6
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
It's very common (and safe) to use the `this` keyword in a static member definition:
```js
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.
Contributor guide
Assessment
This issue has not been assessed yet.