Skip to content
This repository was archived by the owner on May 19, 2018. It is now read-only.

Decorators Stage 2 Parsing #587

Merged
merged 14 commits into from
Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disallow exports between decorator & class body
For stage 2 decorators
  • Loading branch information
peey committed Jun 17, 2017
commit b5e23835ce6875605078adc4c8142a1214fc3007
4 changes: 4 additions & 0 deletions src/parser/statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ export default class StatementParser extends ExpressionParser {
}

parseDecorators(allowExport?: boolean): void {
if (this.hasPlugin("decorators-stage-2")) {
allowExport = false;
}

while (this.match(tt.at)) {
const decorator = this.parseDecorator();
this.state.decorators.push(decorator);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"sourceType": "module"
"sourceType": "module",
"throws": "Leading decorators must be attached to a class declaration (2:0)"
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading