packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method-loose/exfiltrated/exec.js
raw| 1 | let exfiltrated; |
| 2 | |
| 3 | class Cl { |
| 4 | static #privateStaticMethod() { |
| 5 | return 1017; |
| 6 | } |
| 7 | |
| 8 | constructor() { |
| 9 | if (exfiltrated === undefined) { |
| 10 | exfiltrated = Cl.#privateStaticMethod; |
| 11 | } |
| 12 | expect(exfiltrated).toStrictEqual(Cl.#privateStaticMethod); |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | new Cl(); |
| 17 | // check for private method function object equality |
| 18 | new Cl(); |
| 19 | |
| 20 | expect(exfiltrated()).toEqual(1017); |