When super appears in a derived class, it must be used, not just left as an empty statement:
class Base {
method() {
console.log("Base#method");
}
}
class A extends Base {
method() {
super; // Error
}
}
Fix: Invoke super as a function.
Utilize super()
in the method:
class Base {
method() {
console.log("Base#method");
}
}
class A extends Base {
method() {
super();
}
}
Fix: Access a property of super.
Access some property of the ancestor:
class Base {
prop = "prop";
}
class A extends Base {
constructor() {
console.log(super.prop);
}
}