Use expectPlugin

This commit is contained in:
Daniel Tschinder
2017-08-20 12:54:41 +02:00
committed by Henry Zhu
parent 96bd271495
commit 19c099d116
6 changed files with 8 additions and 7 deletions

View File

@@ -1152,13 +1152,13 @@ export default class StatementParser extends ExpressionParser {
parseClassProperty(node: N.ClassProperty): N.ClassProperty {
if (!node.typeAnnotation) {
this.expectOnePlugin(["classProperties"]);
this.expectPlugin("classProperties");
}
this.state.inClassProperty = true;
if (this.match(tt.eq)) {
this.expectOnePlugin(["classProperties"]);
this.expectPlugin("classProperties");
this.next();
node.value = this.parseMaybeAssign();
} else {
@@ -1166,6 +1166,7 @@ export default class StatementParser extends ExpressionParser {
}
this.semicolon();
this.state.inClassProperty = false;
return this.finishNode(node, "ClassProperty");
}