typeof now has string literal union type

Previously, it was just a string
This commit is contained in:
Nathan Shively-Sanders
2017-01-31 10:28:02 -08:00
parent 445421b68b
commit d77945fe1f

View File

@@ -14609,7 +14609,9 @@ namespace ts {
function checkTypeOfExpression(node: TypeOfExpression): Type {
checkExpression(node.expression);
return stringType;
const types: Type[] = [];
typeofEQFacts.forEach((_, s) => types.push(getLiteralTypeForText(TypeFlags.StringLiteral, s)));
return getUnionType(types);
}
function checkVoidExpression(node: VoidExpression): Type {