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
SWC compress seems to be inlining values for a param override, even when there are paths where the override might not happen. This does not happen for local variables (e.g. let output = 'a output'), only for variables which come from function params.
In the playground I was able to confirm correct behavior in 1.3.78, with 1.3.79+ having issues. I looked through the changelog for 1.3.79 but nothing immediately jumped out to me as a definite cause. Maybe #7839?
The text was updated successfully, but these errors were encountered:
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
SWC compress seems to be inlining values for a param override, even when there are paths where the override might not happen. This does not happen for local variables (e.g.
let output = 'a output'
), only for variables which come from function params.Input code
Config
No response
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.3.79&code=H4sIAAAAAAAAA02NUQqAIBBE%2Fz3F%2FK1CdIDAw2hkBOJG6Vd199Ys6GcZ3szshJLGvHDCVpIO0c0DyBFOkKcOXPJaMqywV5PBoYAl4EnDWlujjeJX8F9B%2BKXkjJx2jlMfedbNMkqMuiuLpgn5pG7xOwn0kwAAAA%3D%3D&config=H4sIAAAAAAAAA4VWO2%2FbMBDe8ysCzS4cZOjQqWiDoF26dCwKgSaP8iV8COQxsRDkv%2FdIKZZtUe5m8%2Ft4j%2B8e1NvN7W3zFGXz5faNf%2FIfOBAEJ8wPMD2EyIAWJsKmoIz3IkQIR345i4MjceCzhoYeogzYU7OZcYoZpJDg5FANTliUP23vA1VgkD4I8iWEjE3Q%2B0kktI%2FngQQQkj4pb7d98BoNuo4Jf44EpmxffXiOvZAQtx3SPu22zitorVfJ8NnXksL2aKk5Xv67iOAZoP9uRIy%2FhIV4kUNDInSQM2sg3t%2Fd3zUzEoSL2gd7Hn2K8AAaHTz6UMw%2BIhi1KAEzDXRCDg8fEi3VK%2BGfWedDLFL%2F9ilIyGGNpM0pJSRHaAsqEnkrCOU5g4P8ltAQuovCsDALgSw61MN5ltLbPkCMl9GxWsmCo0q%2BBQ3%2B9VLiguy8NyDcVawVsUVH0FU6egrKGNFHaF9EqFrKUYuA0dcdZTgRqJb7rl9hOIWEnkeriisQqpXciVUQA0jCl0WTjSj75KsucrLV7ApBwS51HSybJQ%2F9izBJUNU3HEq5OPKq7b3HSK1Ori7sCK%2BqMsKT6MvbqNsAlIKr3X3y6FbrlUezlXmI3DSbS%2BuFo7nv1i3o%2F9xGx%2FOKNFQZxq9k7Xh8CVpEXVU8qwWBsF7tACpJyIrLemATYVXUiLzuQGvuqKqD%2BIok93XneTl6XYW4A4Su998ItccZXmXkMbpKeOSsaa0VJw4vrf01PA52581VNxZo72ubd6ZwkchfIwTeNof%2BGiM5Vda9WiHxqlUrq4SHhnxrYPlwlv7hoWK7bWf8bl43854%2BeSiscN28NT4W%2BM1EasZXcf46yPUfX7TPzUz62PKjjfd%2FTAene1UIAAA%3D
SWC Info output
No response
Expected behavior
In the code above,
flag
can be eithera
orb
. I would expect theflag === 'b'
check to remain in the output:Actual behavior
With SWC compress turned on, it appears to assume that
flag === 'b'
is always true and inlines theoutput
override value.Version
1.3.79+
Additional context
In the playground I was able to confirm correct behavior in
1.3.78
, with1.3.79+
having issues. I looked through the changelog for1.3.79
but nothing immediately jumped out to me as a definite cause. Maybe #7839?The text was updated successfully, but these errors were encountered: