Files
Huáng JùnliàngandGitHub 980dcb8b01 Memoize class binding when compiling private methods and static elements (#15701)
* add test cases

* fix: memoise class binding when lowering static elements and private methods

* update test fixtures

* update test fixtures
2023-07-19 17:59:21 -04:00

23 lines
368 B
JavaScript

class A {
static prop = 1;
}
class B extends A {
static prop = 2;
static propA = super.prop;
static getPropA = () => super.prop;
}
const { prop, propA, getPropA } = B;
expect(prop).toBe(2);
expect(propA).toBe(1);
expect(getPropA()).toBe(1);
const oldB = B;
B = null;
expect(oldB.prop).toBe(2);
expect(oldB.propA).toBe(1);
expect(oldB.getPropA()).toBe(1);