dillon1000/react

Commit

Fix last(?) order of evaluation bug

Not to get ahead of myself (sorry i had to), but i think this is the last order 
of evaluation bug. At least it's the last one we know of[1]. Per the previous 
PR, the issue is that constant propagation can copy the last value of a sequence 
expression to where the sequence is used, leaving the original sequence 
expression out of order after other instructions are moved around. We fix that 
here by explicitly skipping constant propagation for the last value of a 
sequence block. 

[1] There are some places where we _would_ have evaluation order bugs if we 
allowed arbitrary expressions, but we explicitly limit the expressions we allow 
in those places. For the curious: switch test case values and destructuring 
default values.
Browse files
Changed paths5 files
First-parent comparison
M compiler/forget/src/HIR/BuildHIR.ts ModifiedM compiler/forget/src/HIR/HIR.ts ModifiedM compiler/forget/src/Optimization/ConstantPropagation.ts ModifiedR compiler/forget/src/__tests__/fixtures/compiler/_bug.computed-call-evaluation-order.expect.md →compiler/forget/src/__tests__/fixtures/compiler/computed-call-evaluation-order.expect.md RenamedR compiler/forget/src/__tests__/fixtures/compiler/_bug.computed-call-evaluation-order.js →compiler/forget/src/__tests__/fixtures/compiler/computed-call-evaluation-order.js Renamed
Patch

Files changed

Rendering syntax-highlighted changes…