Make parseTypeOrTypePredicate terser.

This commit is contained in:
Nathan Shively-Sanders 2016-01-13 09:31:06 -08:00
parent 9b13a0c5b9
commit a9f2cb6d6e

View file

@ -2541,11 +2541,7 @@ namespace ts {
}
function parseTypeOrTypePredicate(): TypeNode {
let typePredicateVariable: Identifier;
if (isIdentifier()) {
typePredicateVariable = tryParse(parseTypePredicatePrefix);
}
const typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
const type = parseType();
if (typePredicateVariable) {
const node = <TypePredicateNode>createNode(SyntaxKind.TypePredicate, typePredicateVariable.pos);