dillon1000/react

Commit

[codegen] validate that temporary values are set

In codegen when we lower an operand we check to see if we have an already 
lowered value for it (stored in `cx.temp`). Currently we silently handle missing 
values by emitting a raw identifier, but this is really an error. This PR adds 
validation, which uncovered a few places where we legitimately won't have a 
value - things like function parameters that got swapped for temporaries bc of 
destructuring. We populate those as `null` values now, and fail if a temporary 
had a truly missing value.
Browse files
Changed paths5 files
First-parent comparison
M compiler/forget/src/HIR/PrintHIR.ts ModifiedM compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts ModifiedM compiler/forget/src/ReactiveScopes/PrintReactiveFunction.ts ModifiedM compiler/forget/src/__tests__/fixtures/compiler/_bug.jsx-tag-evaluation-order.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/_bug.jsx-tag-evaluation-order.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…