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

This reverts commit 976edfc067.
This commit is contained in:
Logan Smyth
2016-02-06 18:36:31 -08:00
parent 89ae1dc258
commit 63b328ce87
7 changed files with 5 additions and 21 deletions

View File

@@ -5,5 +5,5 @@ class Child extends Parent {
scopedFunctionWithThis = () => {
this.name = {};
};
}
}

View File

@@ -1,7 +1,7 @@
call(class {
static test = true;
static test = true
});
export default class {
static test = true;
static test = true
};

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,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"]
}