Fix decorators2 to support export @decorator class A {} (#767)

* Fix decorators2 to support `export @decorator class A {}`

* change to better error message

Also ensure that null/undefined options get default value
This commit is contained in:
Daniel Tschinder
2017-10-29 12:20:15 +01:00
committed by GitHub
parent 8f8ea04b62
commit 86abc16b37
15 changed files with 350 additions and 64 deletions

View File

@@ -1424,7 +1424,8 @@ export default class StatementParser extends ExpressionParser {
this.state.type.keyword === "let" ||
this.state.type.keyword === "function" ||
this.state.type.keyword === "class" ||
this.isContextual("async")
this.isContextual("async") ||
(this.match(tt.at) && this.expectPlugin("decorators2"))
);
}