google / google/closure-compiler

Please do not modify 'super' in static methods!

Open
#3,345 8 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.