Incorporate suggestions from review
This commit is contained in:
parent
c3b992e031
commit
f2ad94d0e3
@ -171,13 +171,12 @@ export default class StatementParser extends ExpressionParser {
|
||||
currentContextDecorators.push(decorator);
|
||||
}
|
||||
|
||||
if (allowExport && this.match(tt._export)) {
|
||||
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 a decorator and a class is not allowed. Please use `export @dec class` instead");
|
||||
if (this.match(tt._export)) {
|
||||
if (allowExport) {
|
||||
return;
|
||||
} else {
|
||||
this.raise(this.state.start, "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead");
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.match(tt._class)) {
|
||||
|
||||
@ -90,7 +90,8 @@ export default class State {
|
||||
labels: Array<{ kind: ?("loop" | "switch"), statementStart?: number }>;
|
||||
|
||||
// Leading decorators. Last element of the stack represents the decorators in current context.
|
||||
// Supports nesting of decorators, e.g. @foo(@bar class {}) class {}
|
||||
// Supports nesting of decorators, e.g. @foo(@bar class inner {}) class outer {}
|
||||
// where @foo belongs to the outer class and @bar to the inner
|
||||
decoratorStack: Array<Array<N.Decorator>>;
|
||||
|
||||
// Token store.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user