Skip to content

Commit

Permalink
🤖 Pick PR #57853 (Revert PR 56161) into release-5.4 (#57854)
Browse files Browse the repository at this point in the history
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
  • Loading branch information
TypeScript Bot and jakebailey authored Mar 19, 2024
1 parent ca8e720 commit cd06f92
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 31 deletions.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45377,7 +45377,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
else {
const text = getTextOfPropertyName(member.name);
if (isNumericLiteralName(text)) {
if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
}
}
Expand Down
10 changes: 0 additions & 10 deletions tests/baselines/reference/enumWithInfinityProperty.errors.txt

This file was deleted.

10 changes: 0 additions & 10 deletions tests/baselines/reference/enumWithNaNProperty.errors.txt

This file was deleted.

This file was deleted.

0 comments on commit cd06f92

Please # to comment.