-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Infinity
in enums
#15774
fix: Infinity
in enums
#15774
Conversation
liuxingbaoyu
commented
Jul 11, 2023
•
edited by gitpod-io
bot
Loading
edited by gitpod-io
bot
Q | A |
---|---|
Fixed Issues? | Fixes #15768 |
Patch: Bug Fix? | √ |
Major: Breaking Change? | |
Minor: New Feature? | |
Tests Added + Pass? | √ |
Documentation PR Link | |
Any Dependency Changes? | |
License | MIT |
StateEnum[StateEnum["pos"] = Infinity] = "pos"; | ||
StateEnum[StateEnum["nan"] = NaN] = "nan"; | ||
StateEnum[StateEnum["ext"] = 42] = "ext"; | ||
StateEnum[StateEnum["ext2"] = 1] = "ext2"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is inconsistent with TS, if we want to align, it is most convenient to add a feature in traverse
.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/54834/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also related: microsoft/TypeScript#48956
@@ -0,0 +1,11 @@ | |||
const v = 42; | |||
const v2 = Infinity; | |||
var Infinity = 1; // Known inconsistencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in scripts this doesn't actually change the value of Infinity
. However, there is another case in which it does and TS is not behaving as I would expect: microsoft/TypeScript#54981