-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Constant folding doesn't simplify inequalities #3645
Comments
This was referenced May 21, 2024
This was referenced May 29, 2024
This was referenced Jun 2, 2024
This was referenced Jun 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Esbuild performs Constant Folding on equality checks where both sides are constant and known. So
if(5 == 5)
get's simplified toif(true)
, which get's simplified further to omit the branching all together.Esbuild currently doesn't do this for inequality checks, such as
<=
,>=
,>
,<
.if(5 >= 5)
does not get simplified toif(true)
. I would expect inequalities to also get folded.Playground Link
The text was updated successfully, but these errors were encountered: