* 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 🚧
21 lines
297 B
JavaScript
21 lines
297 B
JavaScript
class Cl {
|
|
#privateField = 0;
|
|
counter = 0;
|
|
|
|
get #privateFieldValue() {
|
|
return this.#privateField;
|
|
}
|
|
|
|
get self() {
|
|
this.counter++;
|
|
return this;
|
|
}
|
|
|
|
constructor() {
|
|
this.self.#privateFieldValue = 1
|
|
([this.self.#privateFieldValue] = [1]);
|
|
}
|
|
}
|
|
|
|
const cl = new Cl();
|