Fix range on TypeScript this type predicate (#9339)

This commit is contained in:
Armano
2019-01-15 10:35:49 +01:00
committed by Nicolò Ribaudo
parent 694e3fd8cf
commit e8038863c3
3 changed files with 368 additions and 1 deletions

View File

@@ -264,7 +264,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
tsParseThisTypePredicate(lhs: N.TsThisType): N.TsTypePredicate {
this.next();
const node: N.TsTypePredicate = this.startNode();
const node: N.TsTypePredicate = this.startNodeAtNode(lhs);
node.parameterName = lhs;
node.typeAnnotation = this.tsParseTypeAnnotation(/* eatColon */ false);
return this.finishNode(node, "TSTypePredicate");