You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sapphi-red
changed the title
Incorrect minification with a bigint value created by a binary operator inside conditions
[minifier] Incorrect minification with a bigint value created by a binary operator inside conditions
Feb 7, 2025
Describe the bug
(a | b) === 0
is compressed into(a | b) == 0
and causing the code to behave differently after minification.Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.10.14&code=H4sIAAAAAAAAA0utKMgvKlFIK81LLsnMz1NIy8%2FXSNRRSNJUqOblUlDITFPQ0EhUqAEJ2NraKhhAxRUUSjKK8ssV8lLLFVyLivKLNDRBwrW8XLUAKvcWwFIAAAA%3D&config=H4sIAAAAAAAAA41VwW7bMAy99ysCn3doeyiGfcBu%2BwZBsShHmSwaIuUmKPLvoxU7TRva2CWI%2BfRIkXykPp52u%2BZIbfNr9yF%2F5WOwmSDfvsVC58T2JJYG2t5Sm8PAzY8FPdIEeRsJqulyRRq2uQOuLHp9fn2ZGU1EJFgYs60PKfjzfcwW%2ByED0Z1NrOKy9JCYvvJnLOP7BHAu9%2FY9YgSbNhBjyYTE0EHWHLcYox0IzGiz4mW6qc2BUAsxgYXBmSHjoOLJBQ6YJOYj6sA606IDBQoZWg4jaDSJJbREkp6ST4Ud7EvX1T5%2FY8NoY7GsxIRTbYncVvF6wEBsfElaCa%2FgSg2u4Fzc78zgTQYuOT3yjhjSSk%2F%2BAkgFoiVKtgfNbz3hRU9rbL%2FJDMmLZPms4KJvLcsEnRTVhOCVyk6VgcxB62YGV1qYKttq15nhlfJRcGDAe9GK4preA7cHLSifB0CvANJf6zVVXQFzm8IVfBqIDfi3ZMm6wOYTveXDOkrnfo9xI0APfEC3cUBawbgOZ9kSp2EdL8mBSAOceqRQBR6XgAwAo4l1Xz5oQ8ZDPJou4v5zTcwHLrc93NvU1Xm%2F25eMQ4QR4pqM%2F2NENlG52zipepnsh%2BmFn5oorQxeeHn%2B8mxIKk%2FLb02q6dGVu4SqJq%2FPyVvzeWh5OZaqNYH%2BLMRap8s%2FdrgRoOMGAAA%3D
SWC Info output
No response
Expected behavior
The output is
Actual behavior
The output is
Version
1.10.14
Additional context
No response
The text was updated successfully, but these errors were encountered: