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