Input:
class C extends S {
constructor() {
super();
this.f = async () => this;
}
}
Transformed by async-to-generator:
class C extends S {
constructor() {
var _this = this;
super();
this.f = _asyncToGenerator(function*() {
return _this;
});
}
}
Oxc Playground
Problem is that this is now accessed before super(), which is an error.
Babel puts _this = this after super():
class C extends S {
constructor() {
var _this;
super();
_this = this;
this.f = _asyncToGenerator(function*() {
return _this;
});
}
}
Note it gets a bit more complicated than that: Babel REPL