Open JabX opened 8 years ago
Heard you like super
from parent's parent's parent
Can you provide some actual code I can use to reproduce? 💃
Also--this is in TypeScript again right?
Yup, still in Typescript.
Code would be like
@autobind
class A {
method() {
console.log(this.test);
}
}
@autobind
class B extends A {
}
@autobind
class C extends B {
}
@autobind
class D extends C {
test = 'hello';
method() {
super.method();
}
}
I encoutered the issue again yesterday and it made me think that if the problem is really related to the way Typescript transpile classes down to ES5, you should be able to reproduce that with Babel with the "loose-class-transform" option. It essentially ditches the strictness of the default transpilation to something lighter that performs better and works on older browsers (I think it the default only works on IE 11), which is very similar to what Typescript does.
Hello it's me again, from #69 Your fix worked for a
super
call on the parent's parent, but when I try to go even further up the chain I'm it still doesn't bind properly. I'm sorry to bother you with such edge cases, but you'd be my hero if you could find a solution. Thanks.