Allow this.state.clone() when parsing decorators (#262)

Adding the line `this.state = this.state.clone();` in a parser plugin 
(specifically, in my case `parseExprAtom`)
would break decorators. 

This change fixes that.
This commit is contained in:
Alex Rattray 2017-01-01 23:37:05 -10:00 committed by Daniel Tschinder
parent 1c13800efd
commit 68bb1c6598

View File

@ -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)) {