Skip to content

Enum value 1 / 0 incorrectly transformed if there is Infinity declared in scope #55091

Description

Bug Report

🔎 Search Terms

infinity enum variable let shadow

🕗 Version & Regression Information

Every version I tested

⏯ Playground Link

Playground link with relevant code

💻 Code

{letInfinity=3;enumA{X=1/0}console.log(A.X)}

🙁 Actual behavior

{letInfinity=3;letA;(function(A){A[A["X"]=Infinity]="X";})(A||(A={}));console.log(A.X);}

and logs 3

🙂 Expected behavior

It should log the result of 1 / 0, which is Infinity.

Somewhat related to #54981.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: enumEnums and their associated types/valuesFix AvailableA PR has been opened for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions