Files
test-repo/tests/format/js/babel-plugins/destructuring-private.js
T
Sosuke Suzuki 8c49fd0f6f Support destructuring private proposal (#12276)
* Enable `destructuringPrivate` plugiin

* Add tests

* Add changelog

* Add more tests
2022-02-14 11:28:47 +09:00

13 lines
234 B
JavaScript

class Foo {
#x = 1;
constructor() {
console.log(this.#x); // => 1
const { #x: x } = this;
console.log(x); // => 1
}
equals({ #x: otherX }) {
const { #x: currentX } = this;
return currentX === otherX;
}
}