dillon1000/react

Commit

Object and array destructuring support in declaration/assignment

Implements support for array and object de-structuring in variable declarations 
and assignment expressions. Note that the code currently makes the overly 
optimistic assumption that the RHS is an array or object that can be safely 
indexed into. The correct representation would instead treat the RHS as possibly 
iterable, but we need to consider the appropriate representation. I think it's 
worth landing a first optimistic pass and we can iterate forward, this helps 
make it more clear what the ideal representation would have to be and should 
make a bunch of examples work. It also allows us to experiment with 
representations of, and handling for, scope dependencies that involve computed 
property access.
Browse files
Changed paths5 files
First-parent comparison
M compiler/forget/src/HIR/BuildHIR.ts ModifiedA compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.expect.md AddedA compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.js AddedA compiler/forget/src/__tests__/fixtures/hir/destructuring.expect.md AddedA compiler/forget/src/__tests__/fixtures/hir/destructuring.js Added
Patch

Files changed

Rendering syntax-highlighted changes…