-
-
Notifications
You must be signed in to change notification settings - Fork 778
Labels
Description
For input
let o = {
f() {
assert.ok(this !== o);
}
};
(1, o.f)();
(1, o.f)``;
(true && o.f)();
(true && o.f)``;
(true ? o.f : false)();
(true ? o.f : false)``;Esbuild's output
let o={f(){assert.ok(this!==o)}};(0,o.f)(),(0,o.f)``,(0,o.f)(),(0,o.f)``,(0,o.f)(),(0,o.f)``;Oxc's output
let o = {f() {
assert.ok(this !== o);
}};
(1, o.f)();
(1, o.f)``;
o.f();
o.f``;
(!0 ? o.f : !1)();
(!0 ? o.f : !1)``;In short, (true && o.f)``; is simplify to o.f`` , which causes this pointing to a wrong object..
Related:
Dunqing and kermanx