* fix: support static private field destructure set ([C.#p] = [0]) * 🚧 * fix: add compatibility warning for older @babel/helper versions * refactor: extract common routines among classPrivateFiled helpers * More 🚧
15 lines
221 B
JavaScript
15 lines
221 B
JavaScript
class Foo {
|
|
static #client
|
|
|
|
constructor(props) {
|
|
;({ client: Foo.#client } = props)
|
|
}
|
|
|
|
getClient() {
|
|
return Foo.#client;
|
|
}
|
|
}
|
|
|
|
const foo = new Foo({ client: 'bar' });
|
|
expect(foo.getClient()).toBe('bar');
|