fix(ts): include asserts in TSTypePredicate location (#12763)

This commit is contained in:
Federico Ciardi
2021-02-05 20:02:41 +01:00
committed by GitHub
parent eccbcca948
commit bf523da0b0
2 changed files with 4 additions and 3 deletions

View File

@@ -1068,6 +1068,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
node.asserts = true;
thisTypePredicate = this.finishNode(node, "TSTypePredicate");
} else {
this.resetStartLocationFromNode(thisTypePredicate, node);
(thisTypePredicate: N.TsTypePredicate).asserts = true;
}
t.typeAnnotation = thisTypePredicate;