packages/babel-plugin-proposal-class-properties/test/fixtures/private/destructuring-array-pattern-1/exec.js
raw| 1 | class Foo { |
| 2 | #client |
| 3 | |
| 4 | constructor(props) { |
| 5 | this.#client = 1; |
| 6 | ;([this.x = this.#client, this.#client, this.y = this.#client] = props); |
| 7 | } |
| 8 | |
| 9 | getClient() { |
| 10 | return this.#client; |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | const foo = new Foo([undefined, 'bar']); |
| 15 | expect(foo.getClient()).toBe('bar'); |
| 16 | expect(foo.x).toBe(1); |
| 17 | expect(foo.y).toBe('bar'); |