dillon1000/react
Commit
Browse files [test][ssa] Add todo test for reassigning in rval
From my understanding, `LeaveSSA` is not currently handling reassignment in rvals. Source code ```js let x = foo(); x(x = bar()); ``` Simplified HIR (from EnterSSA) ``` [1] $1 = StoreLocal Let x$0 = [[ foo() ]] // x$1 = foo() [2] $2 = LoadLocal x$1 // t0 = x$1 [3] $4 = StoreLocal Reassign x$3 = [[ bar() ]] // t1 = x$3 = bar() [4] $5 = CallExpression $2 ($4) // t0(t1) ``` codegen: ```js let x; x = foo(); x = bar(); x(x); ```
Changed paths2 files
First-parent comparisoncompiler/forget/src/__tests__/fixtures/compiler/_bug.ssa-reassign-in-rval.expect.md AddedA compiler/forget/src/__tests__/fixtures/compiler/_bug.ssa-reassign-in-rval.js AddedPatch
Files changed
Rendering syntax-highlighted changes…