Temporary rollback for erroring on trailing comma with spread (#154)

This commit is contained in:
Henry Zhu
2016-10-01 20:08:25 -04:00
committed by GitHub
parent 1285131e3e
commit 5bac6e8ad9
3 changed files with 246 additions and 4 deletions

View File

@@ -722,7 +722,9 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) {
} else if (this.eat(tt.braceR)) {
break;
} else if (this.match(tt.comma) && this.lookahead().type === tt.braceR) {
this.unexpected(position, "A trailing comma is not permitted after the rest element");
// TODO: temporary rollback
// this.unexpected(position, "A trailing comma is not permitted after the rest element");
continue;
} else {
firstRestLocation = position;
continue;