23 lines
313 B
JavaScript

class Point {
getX() {
expect(this.x).toBe(3); // C
}
}
class ColorPoint extends Point {
constructor() {
super();
this.x = 2;
super.x = 3;
expect(this.x).toBe(3); // A
expect(super.x).toBeUndefined(); // B
}
m() {
this.getX()
}
}
const cp = new ColorPoint();
cp.m();