packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/this/exec.js
raw| 1 | class A { |
| 2 | static get a() { return 1 } |
| 3 | } |
| 4 | |
| 5 | class B extends A { |
| 6 | static get b() { return 2 } |
| 7 | |
| 8 | static #getA() { return super.a } |
| 9 | static #getB() { return this.b } |
| 10 | |
| 11 | static extract() { |
| 12 | return [this.#getA, this.#getB]; |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | const [getA, getB] = B.extract(); |
| 17 | expect(getA.call({ a: 3 })).toBe(1); |
| 18 | expect(getB.call({ b: 4 })).toBe(4); |