* Enable `destructuringPrivate` plugiin * Add tests * Add changelog * Add more tests
16 lines
423 B
Markdown
16 lines
423 B
Markdown
#### Support destructuring private proposal (#12276 by @sosukesuzuki)
|
|
|
|
Support [Stage 2 TC39 proposal destructuring private fields](https://github.com/tc39/proposal-destructuring-private) via [Babel 7.17](https://babeljs.io/blog/2022/02/02/7.17.0).
|
|
|
|
<!-- prettier-ignore -->
|
|
```jsx
|
|
// Example
|
|
class Foo {
|
|
constructor() {
|
|
console.log(this.#x); // => 1
|
|
const { #x: x } = this;
|
|
console.log(x); // => 1
|
|
}
|
|
}
|
|
```
|