dillon1000/react

Commit

Support computed property access/assignment

Supports computed properties (as LHS and RHS) correctly. Previously we only 
handled member expressions where the property was an identifier, and would 
incorrect treat `a[b]` the same as `a.b`. Now we correctly distinguish these and 
convert `a[b]` as an IndexLoad and `a.b` as a PropertyLoad. Similar for 
assignment, `a[b] = c` is an IndexStore. For both IndexLoad and IndexStore we 
lower the property to a Place first.
Browse files
Changed paths5 files
First-parent comparison
M compiler/forget/src/HIR/BuildHIR.ts ModifiedA compiler/forget/src/__tests__/fixtures/hir/array-access-assignment.expect.md AddedA compiler/forget/src/__tests__/fixtures/hir/array-access-assignment.js AddedA compiler/forget/src/__tests__/fixtures/hir/object-computed-access-assignment.expect.md AddedA compiler/forget/src/__tests__/fixtures/hir/object-computed-access-assignment.js Added
Patch

Files changed

Rendering syntax-highlighted changes…