Closed
Description
We can emit computed properties in ES5, using the following scheme:
var x = {
a: 0,
["b"]: 0,
["c"]() {},
get ["d"]() { return 0 },
set ["d"](x) {},
e: 0
};
emits as:
var x = {
a: 0
};
x["b"]: 0;
x["c"] = function() {};
Object.defineProperty(x, "d" ...);
Object.defineProperty(x, "d" ...);
x.e = 0;
In any other expression context, we would emit a temp variable like we do for destructuring.