It seems you cannot call a superclass arrow function using super.methodName()
within a subclass:
class Parent {
constructor() {
console.log('in `Parent` constructor')
}
parentArrow = () => {
console.log('parentArrowFn')
}
parentMethod() {
console.log('parentMethod')
}
}
class Child extends Parent {
constructor() {
super()
console.log('in `Child` constructor')
}
childMethod() {
console.log('childMethod')
super.parentMethod() // works
super.parentArrow() // Error
}
}
(new Child()).childMethod();
Generates the error:
Uncaught TypeError: (intermediate value).parentArrow is not a function
at Child.childMethod (<anonymous>:21:15)
at <anonymous>:1:7