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
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
Let's have a swap of values in array using destructuring:
It gets compiled into:
which is obviously incorrect:
SyntaxError: Invalid destructuring assignment target
The playground link points to specific code from the molstar library, however, above code is the minimal example.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.9.2&code=H4sIAAAAAAAAA3VSwW6DMAy9V%2Bo%2FWJo0wQYNpKPt2tIv2E47Ig4EwogEBCVBK1v770tKoUXTfCD4%2BcV%2BtoMQSN6KlG6hUKqRW4Q%2BmSpaskh5hSpeSpWI8SQlJ2gTkDVO6JJ4hObB5hWviR9kBNMl9vFytfJe%2FWCVegGSIjU33SpRBaqYTBdKPry9LOez%2BYweGy4U5G2dKsZrkA0TSYkzSyQZa%2BUW6rYiVNjwM5%2BBtpIqOEII3u7md3d%2BymupIKOlSjQaeQ64fjyJSfZNdajPD0%2BA4Rn8CaNIyvyjZ13ICPAkzlu1hagX5lwFxlFs6plSPTXnAiyjjmn8XXe%2BaPiXZfI5gO2dhg9aNLguG3szxnKwLHdUsNfNPj7qzz4cZdkGmXA6g3QTziSpMS160bSysKKjA11s727h86B5EKAHHIY64elk%2Fvfg9RoM6Hb2FT7cwz640P0tGl0WEXmx068k8uPLmNzBG3AvjneAEKRFUn9SyJigl%2Ffwj8gjPIfjzbtOuhs%2Bbv3cH4KqVtRmDBo%2F%2FwLsEprO7wIAAA%3D%3D&config=H4sIAAAAAAAAA31VPY%2FbMAzd71cEmjsUGTp0vivQIehQ4FZBsShHV1kyRCqXIPB%2FLy07H5fQ2Sw%2BPlLix%2FPpZbVSH9ion6sTf%2FKhNxkhX85swWMkc2CLomMP2GTfk%2Fp2RglHyJmAUE3DhCgyuQUaWYDr7%2Bv1zFAhJYQzY7Z1Pnp3vM3ZpK7PgHhjYyuHLB1Ewq%2F8GcvpcwQol1v7NqUAJj5BtEHtI0ELWQrcpBBMj6D3JgtRxpua7DFJKUawEFjd59SLeLSefIqc8xG1YKxukgUB8hka8nuQaJyLaRH5ecJ7KmxhW9q29vmODXsTiiEhJxxqS%2Fi2QtRd8kjalSiVcAIXajCBc3Hvmd7pDFRyfOR9JB8XevIPgCsQDGI0HUhxq4fjeVpiu6dMHx2PLB0FnOdbemWElouqvXdCZcfKQCYvdTODLQ2MlW2k68zwQvnQW9DgHM%2BKEBo%2FPTU7Kem46MkJAPfXOGmqJkBftnABHxfiCfyLX0nygM0enaHdMorHbpvCkwQd0C7ZJw7cCkrLcGaVOPTLeIkWeDTAii4FK%2FAoArwAlHSoevkwG7weHFG3IW2vMjE7DBcd7kxs7%2Ff9osWZZc6l3H2VWE67SbaEOgEndU1wUlUf6tfvv%2Fr17V1v%2Fry%2BjWJeo6thGKYEL3MS1dVA19%2FIOEGT%2BP9QV6ezzl%2FuqDxuzsz6rOE%2FQnOQmpIGAAA%3D
SWC Info output
No response
Expected behavior
No substitution of left-hand-side in array destructuring.
Actual behavior
Left side of array destructuring replaced by values.
Version
1.9.2
Additional context
Version 1.2.249 works as expected. In version 1.3.107 it's broken. So the bug may have started during development of 1.3.
Workaround: Turn off Compress. Even if you disable all Compress Options, the bug still occurs. You need to turn off Compress.
The text was updated successfully, but these errors were encountered: