-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement object literal rest/spread (...)
As discussed in #245, this syntax is not part of ES6/2015, but it is a stage 2 proposal, meaning the committee expects it to be included in the standard. It's already seeing heavy use by e.g. the React community. This change causes `...expr` in an object literal to be parsed as a unary-node element of an object-node, and modifies places where an element of an object-node is expected to be an infix-node. Note that only weak typing assumptions are made already about object-node elems. In addition, this change implements proper name extraction in object literal destructuring. The cases are: 1. `let {a} = x;` 2. `let {a: b} = x;` (should define `b`) 3. `let {a = b} = x;` (should define `a`) 4. `let {...a} = x;` (should define `a`) This change fixes case (2), which was broken, and adds case (4).
- Loading branch information
Showing
2 changed files
with
57 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters