The StaticSuperPropReplacer pass does not properly account for static inheritance. The following case demonstrates code that is broken by the pass.
class Base {
static foo() {
console.log('base foo');
}
static bar() {
this.foo();
}
}
class Intermediate extends Base {
static baz() {
super.bar(); // changing `super` to `Base` changes `this` in the super call.
}
}
class Child extends Intermediate {
static foo() {
console.log('child foo');
}
}
Child.baz(); // should log "child foo"
This pattern occurs in Polymer: https://github.com/Polymer/polymer/blob/d577c8c8755b3078da605889488e8988eb31c48d/lib/mixins/template-stamp.js#L348
The StaticSuperPropReplacer pass does not properly account for static inheritance. The following case demonstrates code that is broken by the pass.
This pattern occurs in Polymer: https://github.com/Polymer/polymer/blob/d577c8c8755b3078da605889488e8988eb31c48d/lib/mixins/template-stamp.js#L348