mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
18 lines
338 B
JavaScript
18 lines
338 B
JavaScript
class Foo {
|
|
#client
|
|
|
|
constructor(props) {
|
|
this.#client = 'foo';
|
|
;({ x: this.x = this.#client, y: this.#client, z: this.z = this.#client } = props)
|
|
}
|
|
|
|
getClient() {
|
|
return this.#client;
|
|
}
|
|
}
|
|
|
|
const foo = new Foo({ y: 'bar' });
|
|
expect(foo.getClient()).toBe('bar');
|
|
expect(foo.x).toBe('foo');
|
|
expect(foo.z).toBe('bar');
|