Skip to content

Commit cd06f92

Browse files
TypeScript Botjakebailey
TypeScript Bot
andauthored
🤖 Pick PR #57853 (Revert PR 56161) into release-5.4 (#57854)
Co-authored-by: Jake Bailey <[email protected]>
1 parent ca8e720 commit cd06f92

File tree

4 files changed

+1
-31
lines changed

4 files changed

+1
-31
lines changed

src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45377,7 +45377,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4537745377
}
4537845378
else {
4537945379
const text = getTextOfPropertyName(member.name);
45380-
if (isNumericLiteralName(text)) {
45380+
if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
4538145381
error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
4538245382
}
4538345383
}

tests/baselines/reference/enumWithInfinityProperty.errors.txt

-10
This file was deleted.

tests/baselines/reference/enumWithNaNProperty.errors.txt

-10
This file was deleted.

tests/baselines/reference/enumWithNegativeInfinityProperty.errors.txt

-10
This file was deleted.

0 commit comments

Comments
 (0)