add RestProperty node

This commit is contained in:
Sebastian McKenzie 2015-09-15 06:17:45 +01:00
parent eae82799e6
commit bcab30e606
2 changed files with 2 additions and 2 deletions

View File

@ -635,7 +635,7 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) {
}
if (this.hasFeature("objectRestSpread") && this.match(tt.ellipsis)) {
prop = this.parseSpread();
prop.type = "SpreadProperty";
prop.type = isPattern ? "RestProperty" : "SpreadProperty";
node.properties.push(prop);
continue;
}

View File

@ -202,7 +202,7 @@ pp.checkLVal = function (expr, isBinding, checkClashes) {
this.checkLVal(expr.left, isBinding, checkClashes);
break;
case "SpreadProperty":
case "RestProperty":
case "RestElement":
this.checkLVal(expr.argument, isBinding, checkClashes);
break;