Revert "babylon: throw parse error if class properties do not have a semicolon (fixes T6873)"

This reverts commit 976edfc06740e434d1d5b136e28996a77f909403.
This commit is contained in:
Logan Smyth 2016-02-06 18:36:31 -08:00
parent d9ade8a63a
commit 0c35bbfc07
5 changed files with 2 additions and 18 deletions

View File

@ -595,7 +595,7 @@ pp.parseClass = function (node, isStatement, optionalId) {
};
pp.isClassProperty = function () {
return this.match(tt.eq) || this.match(tt.semi) || this.canInsertSemicolon();
return this.match(tt.eq) || this.isLineTerminator();
};
pp.parseClassBody = function (node) {
@ -747,9 +747,7 @@ pp.parseClassProperty = function (node) {
} else {
node.value = null;
}
if (!this.eat(tt.semi)) {
this.raise(this.state.start, "A semicolon is required after a class property");
}
this.semicolon();
return this.finishNode(node, "ClassProperty");
};

View File

@ -1,3 +0,0 @@
class A {
asdf = 1
}

View File

@ -1,4 +0,0 @@
{
"throws": "A semicolon is required after a class property (3:0)",
"plugins": ["classProperties"]
}

View File

@ -1,4 +0,0 @@
{
"throws": "A semicolon is required after a class property (3:0)",
"plugins": ["classProperties"]
}