google / google/closure-compiler
Please do not modify 'super' in static methods!
Open
internal-issue-created
triage-done
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
input:
```javascript
class A {
static ['method']() {
return this.name;
}
}
class B extends A {
static ['method']() {
return '+' + super['method']();
}
}
console.log( A['method']() ); // A
console.log( B['method']() ); // +B
```
After compilation, you replace the ```super``` with a direct link to the class, which leads to incorrect work of the code.
output:
```javascript
class a {
static ["method"]() {
return this.name;
}
}
class b extends a {
static ["method"]() {
return "+" + a.method();
}
}
console.log(a.method()); // a
console.log(b.method()); // a
```
Contributor guide
Assessment
This issue has not been assessed yet.