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:
parent
1c13800efd
commit
68bb1c6598
@ -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)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user