packages/babel-plugin-proposal-private-methods/test/fixtures/private-method/exfiltrated/exec.js
raw| 1 | let exfiltrated; |
| 2 | class Foo { |
| 3 | #privateMethod() {} |
| 4 | |
| 5 | constructor() { |
| 6 | if (exfiltrated === undefined) { |
| 7 | exfiltrated = this.#privateMethod; |
| 8 | } |
| 9 | expect(exfiltrated).toStrictEqual(this.#privateMethod); |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | new Foo(); |
| 14 | // check for private method function object equality |
| 15 | new Foo(); |