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

Commit

Permalink
Allow this.state.clone() when parsing decorators (#262)
Browse files Browse the repository at this point in the history
Adding the line `this.state = this.state.clone();` in a parser plugin 
(specifically, in my case `parseExprAtom`)
would break decorators. 

This change fixes that.
  • Loading branch information
rattrayalex authored and danez committed Jan 2, 2017
1 parent 1c13800 commit 68bb1c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parser/statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ pp.takeDecorators = function (node) {

pp.parseDecorators = function (allowExport) {
while (this.match(tt.at)) {
this.state.decorators.push(this.parseDecorator());
let decorator = this.parseDecorator();
this.state.decorators.push(decorator);
}

if (allowExport && this.match(tt._export)) {
Expand Down

0 comments on commit 68bb1c6

Please sign in to comment.