Apply location data fix to decorators plugin (#699)

This commit is contained in:
James Henry
2017-08-26 16:38:11 +01:00
committed by Justin Ridgewell
parent 8f2f250144
commit acf0e65090
19 changed files with 41 additions and 45 deletions

View File

@@ -199,9 +199,7 @@ export default class StatementParser extends ExpressionParser {
];
if (decorators.length) {
node.decorators = decorators;
if (this.hasPlugin("decorators2")) {
this.resetStartLocationFromNode(node, decorators[0]);
}
this.resetStartLocationFromNode(node, decorators[0]);
this.state.decoratorStack[this.state.decoratorStack.length - 1] = [];
}
}
@@ -891,9 +889,7 @@ export default class StatementParser extends ExpressionParser {
// steal the decorators if there are any
if (decorators.length) {
member.decorators = decorators;
if (this.hasPlugin("decorators2")) {
this.resetStartLocationFromNode(member, decorators[0]);
}
this.resetStartLocationFromNode(member, decorators[0]);
decorators = [];
}