Adjusted Object Rest/Spread syntax handling to the latest spec (#670)

This commit is contained in:
Mateusz Burzyński
2017-08-25 01:31:50 +02:00
committed by Brian Ng
parent 5df1139567
commit 5d83e2692f
30 changed files with 58 additions and 835 deletions

View File

@@ -1118,8 +1118,9 @@ export default class ExpressionParser extends LValParser {
if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) {
prop = this.parseSpread(isPattern ? { start: 0 } : undefined);
prop.type = isPattern ? "RestElement" : "SpreadElement";
if (isPattern) this.toAssignable(prop.argument, true, "object pattern");
if (isPattern) {
this.toAssignable(prop, true, "object pattern");
}
node.properties.push(prop);
if (isPattern) {
const position = this.state.start;