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
With compress turned on, SWC optimizes numeric string keys in objects and get rid of quotes. But this behavior is too aggressive and breaks codes when the said keys start with zeroes.
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
With
compress
turned on, SWC optimizes numeric string keys in objects and get rid of quotes. But this behavior is too aggressive and breaks codes when the said keys start with zeroes.Input code
Config
Playground link
https://play.swc.rs/?version=1.3.4&code=H4sIAAAAAAAAA0vOzysuUchXsFWoVlA3MDRQt1JQV9dRUDc0MgYxkxKL1BVqebmSgcryc1L1cvLTNfI1ARCZHCY1AAAA&config=H4sIAAAAAAAAA22TQZLjIAxF7%2BJ1b2cWfYDZzRkoAsKhByOXJNJxpXL3Fo4NcTI76%2FEliy9xG77YDZ%2B3YbbEQPWLlyz2OnwOsszAjuIsw8cgrCjYxHDXwNIIohLgX3qWEBm2049hijmGpVZyOM0EzPVbM8oEWbjpLBF%2BayhUNDohJrD5LTaWTcwCI1BPdZiSnRnMxVLLqH%2BzFBnzARUBb2bC%2BYlmHyVi1mI782C9ceihgUjgJF6gS7SGSjJrY62TFXo4lXGs7j2UcLGpWGm14LraoH9seWeMLCaUzC%2Fo0OkDPS65qWIwBFIo75ovjPngwz8A7TNZ5mwn6JkrDzqHozL8RxVz0CHK0qhOuHeVYdTLmRhDu2HtGkhid4vAFwf1hq4X3%2BDhQhw9GAhB3W7J%2FB3FnXuxuokYWqiu2dBn8AjNvk9HWlfgDf7RruR5HBufrJxfGS%2FTCdNbiQnkjP4NqxGCr5B0e6%2FzKy3Zg9oM%2FumgcA3bmurwBU2qT233WRdCc8yY8NTWV1%2FkZPPY1vJeAfpSwW01b32qv4d7f537OvHfTbgW%2BgFVtfDUDwQAAA%3D%3D
Expected behavior
While
'123'
becomes123
, the'010'
remains as it is.Actual behavior
'010'
becomes10
, makingo['010']
failing.Version
1.2.240 ~ 1.3.4
Additional context
Possible cause: #5548
The text was updated successfully, but these errors were encountered: