2029
});
2030
return { kind: "UnsupportedNode", node: lvalueNode, loc };
2031
}
2032
- return {
2033
- kind: "PropertyStore",
2034
- object,
2035
- property: property.node.name,
2036
- value,
2032
+ const temporary = buildTemporaryPlace(builder, loc);
2033
+ builder.push({
2034
+ id: makeInstructionId(0),
2035
+ lvalue: { ...temporary },
2036
+ value: {
2037
+ kind: "PropertyStore",
2038
+ object,
2039
+ property: property.node.name,
2040
+ value,
2041
+ loc,
2042
+ },
2043
loc,
2038
- };
2044
+ });
2045
+ return { kind: "LoadLocal", place: temporary, loc: temporary.loc };
2046
} else {
2047
if (!property.isExpression()) {
2048
builder.errors.push({
2054
return { kind: "UnsupportedNode", node: lvalueNode, loc };
2055
}
2056
const propertyPlace = lowerExpressionToTemporary(builder, property);
2050
- return {
2051
- kind: "ComputedStore",
2052
- object,
2053
- property: propertyPlace,
2054
- value,
2057
+ const temporary = buildTemporaryPlace(builder, loc);
2058
+ builder.push({
2059
+ id: makeInstructionId(0),
2060
+ lvalue: { ...temporary },
2061
+ value: {
2062
+ kind: "ComputedStore",
2063
+ object,
2064
+ property: propertyPlace,
2065
+ value,
2066
+ loc,
2067
+ },
2068
loc,
2056
- };
2069
+ });
2070
+ return { kind: "LoadLocal", place: temporary, loc: temporary.loc };
2071
}
2072
}
2073
case "ArrayPattern": {
2107
followups.push({ place: temp, path: element as NodePath<t.LVal> }); // TODO remove type cast
2108
}
2109
}
2096
- const temp = buildTemporaryPlace(builder, loc);
2110
+ const temporary = buildTemporaryPlace(builder, loc);
2111
builder.push({
2112
id: makeInstructionId(0),
2099
- lvalue: { ...temp },
2113
+ lvalue: { ...temporary },
2114
value: {
2115
kind: "Destructure",
2116
lvalue: {
2128
for (const { place, path } of followups) {
2129
lowerAssignment(builder, path.node.loc ?? loc, kind, path, place);
2130
}
2117
- return { kind: "LoadLocal", place: value, loc: value.loc };
2131
+ return { kind: "LoadLocal", place: temporary, loc: value.loc };
2132
}
2133
case "ObjectPattern": {
2134
const lvalue = lvaluePath as NodePath<t.ObjectPattern>;
2201
}
2202
}
2203
}
2190
- const temp = buildTemporaryPlace(builder, loc);
2204
+ const temporary = buildTemporaryPlace(builder, loc);
2205
builder.push({
2206
id: makeInstructionId(0),
2193
- lvalue: { ...temp },
2207
+ lvalue: { ...temporary },
2208
value: {
2209
kind: "Destructure",
2210
lvalue: {
2222
for (const { place, path } of followups) {
2223
lowerAssignment(builder, path.node.loc ?? loc, kind, path, place);
2224
}
2211
- return { kind: "LoadLocal", place: value, loc: value.loc };
2225
+ return { kind: "LoadLocal", place: temporary, loc: value.loc };
2226
}
2227
default: {
2228
builder.errors.push({