mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
Instance property initializers are moved into constructor. If symbols they reference are shadowed within constructor, rename those symbols.
Input:
```js
class C {
prop = foo();
constructor(foo) {
console.log(foo);
}
}
```
Output:
```js
class C {
constructor(_foo) { // <-- renamed
this.prop = foo(); // <-- moved into constructor
console.log(_foo); // <-- renamed
}
}
```
|
||
|---|---|---|
| .. | ||
| babel.snap.md | ||
| babel_exec.snap.md | ||
| oxc.snap.md | ||
| oxc_exec.snap.md | ||