Use expectPlugin
This commit is contained in:
committed by
Henry Zhu
parent
96bd271495
commit
19c099d116
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user