ES2017: Object Rest/Spread Properties #1588

Closed
ariya opened this Issue Oct 9, 2016 · 2 comments

Projects

Completed in Esprima 4.0

2 participants

@ariya
Contributor
ariya commented Oct 9, 2016 edited

New productions:

PropertyDefinition[Yield] ::
  ...  AssignmentExpression[In, ?Yield]

ObjectAssignmentPattern[Yield] ::
  {AssignmentRestProperty[?Yield]opt}
  {AssignmentPropertyList[?Yield]  ,  AssignmentRestProperty[?Yield]opt}

AssignmentRestProperty[Yield] ::
  ...  DestructuringAssignmentTarget[?Yield]

ObjectBindingPattern[Yield] ::
  {BindingRestProperty[?Yield]opt}
  {BindingPropertyList[?Yield]  ,  BindingRestProperty[?Yield]opt}

BindingRestProperty[Yield] ::
  ...  BindingIdentifier[?Yield]
  ...  BindingPattern[?Yield]

AST format additions:

interface RestProperty <: Node {
    type: "RestProperty";
    argument: Expression;
}

interface SpreadProperty <: Node {
    type: "SpreadProperty";
    argument: Expression;
}

and changes for:

extend interface ObjectPattern {
    properties: [ AssignmentProperty | RestProperty ];
}

extend interface ObjectExpression {
    properties: [ Property | SpreadProperty ];
}

References:

@ariya ariya added the es2017 label Oct 9, 2016
@ariya ariya added this to the 4.0 milestone Oct 9, 2016
@ariya ariya referenced this issue Oct 10, 2016
Open

Release 4.0 #1589

3 of 13 tasks complete
@hzoo
hzoo commented Oct 10, 2016

And it's stage-3 right now (not in es2017)

@ariya ariya self-assigned this Jan 16, 2017
@ariya ariya added a commit to ariya/esprima that referenced this issue Jan 17, 2017
@ariya ariya Support ES2017 object rest/spread properties
Fix #1588
dec2b98
@ariya ariya added a commit that closed this issue Jan 20, 2017
@ariya ariya Support object rest/spread properties
Fix #1588
Closes gh-1732
13e5283
@ariya ariya closed this in 13e5283 Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment