swc
swc copied to clipboard
fix(es/compat): Insert loop Var into closest place
Description:
BREAKING CHANGE:
Related issue (if exists):
- Closes: #8300
This doesn't seem to be the best solution. Consider following example
class Foo extends Bar {
constructor() {
for (const i of [1]) {
setTimeout(() => {
console.log(this)
});
}
super();
}
}
This doesn't seem to be the best solution. Consider following example
class Foo extends Bar { constructor() { for (const i of [1]) { setTimeout(() => { console.log(this) }); } super(); } }
@Austaras Test cases updated. IMO, it's OK
It's not. The problem arises in access this before call super.