swc
swc copied to clipboard
fix(es/es2015): Fix injection location of `this` for getter/setter properties
trafficstars
Description:
Related issue:
- Closes #8992
Pathological example but I think this change might break on arrow functions being inside of computed property names. Can you try:
const o1 = {
x: "a",
foo() {
const o2 = {
get [(() => this.x)()]() {
return 1;
},
};
console.log(o2.a === 1);
},
};
o1.foo();