This commit is contained in:
Daniel Tschinder
2017-02-10 15:36:46 +01:00
committed by GitHub
parent f25a2fbc78
commit c79dd953ea
5 changed files with 525 additions and 1 deletions

View File

@@ -735,8 +735,9 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) {
}
if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) {
prop = this.parseSpread();
prop = this.parseSpread(isPattern ? { start: 0 } : undefined);
prop.type = isPattern ? "RestProperty" : "SpreadProperty";
if (isPattern) this.toAssignable(prop.argument, true, "object pattern");
node.properties.push(prop);
if (isPattern) {
const position = this.state.start;