Helpful error message for @dec export class
This commit is contained in:
parent
f976bdd21c
commit
add8e4ad13
@ -173,6 +173,11 @@ export default class StatementParser extends ExpressionParser {
|
||||
return;
|
||||
}
|
||||
|
||||
// special error for the common case of @dec export class
|
||||
if (!allowExport && this.match(tt._export)) {
|
||||
this.raise(this.state.start, "Using the export keyword between decorators and class is disallowed. Please use `export @dec class` instead");
|
||||
}
|
||||
|
||||
if (!this.match(tt._class)) {
|
||||
this.raise(this.state.start, "Leading decorators must be attached to a class declaration");
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Leading decorators must be attached to a class declaration (2:0)"
|
||||
"throws": "Using the export keyword between decorators and class is disallowed. Please use `export @dec class` instead (2:0)"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user