Use expectPlugin
This commit is contained in:
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");
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'classProperties' (3:2)"
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (3:2)"
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"plugins": ["flow"],
|
||||
"throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'classProperties' (2:14)"
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (2:14)"
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'classProperties' (2:6)",
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (2:6)",
|
||||
"plugins": []
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'classProperties' (2:5)",
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (2:5)",
|
||||
"plugins": []
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'classProperties' (3:2)"
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (3:2)"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user