* Fix super method call in private instance method calling overridden method * Change return value in test fixtures * Update tests to verify that overridden method is not called
22 lines
293 B
JavaScript
22 lines
293 B
JavaScript
class Base {
|
|
superMethod() {
|
|
return 'good';
|
|
}
|
|
}
|
|
|
|
class Sub extends Base {
|
|
superMethod() {
|
|
return 'bad';
|
|
}
|
|
|
|
#privateMethod() {
|
|
return super.superMethod();
|
|
}
|
|
|
|
publicMethod() {
|
|
return this.#privateMethod();
|
|
}
|
|
}
|
|
|
|
expect((new Sub()).publicMethod()).toEqual('good');
|