mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 17:30:04 -05:00
Disallow Infinity, -Infinity and NaN as an enum key name (#56161)
This commit is contained in:
@@ -45022,7 +45022,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
else {
|
||||
const text = getTextOfPropertyName(member.name);
|
||||
if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
|
||||
if (isNumericLiteralName(text)) {
|
||||
error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user