mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-04 05:39:27 -05:00
typeof now has string literal union type
Previously, it was just a string
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user