Revert "babylon: throw parse error if class properties do not have a semicolon (fixes T6873)"
This reverts commit 976edfc06740e434d1d5b136e28996a77f909403.
This commit is contained in:
parent
d9ade8a63a
commit
0c35bbfc07
@ -595,7 +595,7 @@ pp.parseClass = function (node, isStatement, optionalId) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
pp.isClassProperty = function () {
|
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) {
|
pp.parseClassBody = function (node) {
|
||||||
@ -747,9 +747,7 @@ pp.parseClassProperty = function (node) {
|
|||||||
} else {
|
} else {
|
||||||
node.value = null;
|
node.value = null;
|
||||||
}
|
}
|
||||||
if (!this.eat(tt.semi)) {
|
this.semicolon();
|
||||||
this.raise(this.state.start, "A semicolon is required after a class property");
|
|
||||||
}
|
|
||||||
return this.finishNode(node, "ClassProperty");
|
return this.finishNode(node, "ClassProperty");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
class A {
|
|
||||||
asdf = 1
|
|
||||||
}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"throws": "A semicolon is required after a class property (3:0)",
|
|
||||||
"plugins": ["classProperties"]
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
class A {
|
|
||||||
asdf
|
|
||||||
}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"throws": "A semicolon is required after a class property (3:0)",
|
|
||||||
"plugins": ["classProperties"]
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user