@samitouri / QOS-React-2 / commits / 1396ee28a4

[ssa][be] Refactor to be more idiomatic typescript

Sathya Gunasekaran committed Oct 27, 2022 at 14:11 UTC 1396ee28a4033b721ff3f4f78bf4f14452c7a644
1 file changed +4 -3
compiler/forget/src/HIR/SSAify.ts
+4 -3
@@ -298,7 +298,7 @@ function rewriteUses(instr: Instruction, builder: SSABuilder) {
298 }
299 case "JsxExpression": {
300 instrValue.tag = builder.getPlace(instrValue.tag);
301 - for (const [prop, place] of instrValue.props.entries()) {
301 + for (const [prop, place] of instrValue.props) {
302 instrValue.props.set(prop, builder.getPlace(place));
303 }
304 if (instrValue.children) {
@@ -310,8 +310,9 @@ function rewriteUses(instr: Instruction, builder: SSABuilder) {
310 }
311 case "ObjectExpression": {
312 if (instrValue.properties !== null) {
313 - for (const [prop, place] of instrValue.properties) {
314 - instrValue.properties?.set(prop, builder.getPlace(place));
313 + const props = instrValue.properties;
314 + for (const [prop, place] of props) {
315 + props.set(prop, builder.getPlace(place));
316 }
317 }
318 break;