-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Block scoping of const is broken when transpiling to ES5 #3006
Comments
master seems to be fixed, need double confirm once new version's published. |
2 tasks
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Attached code incorrectly transpiles in SWC target ES5:
6 is logged 7 times instead of each number logged once as per const scoping behaviors in ES6.
Wrapping with the async function appears to be necessary to trigger the error
Input code
Config
default playground configuration
Playground link
https://play.swc.rs/?version=1.2.119&code=H4sIAAAAAAAAA22OzQrCMBCE74W%2Bwxw3UIqePCn4Dt5DDBsJtLuYH0oR393UgieHuQwD34zLq3iEKr5EFTgyePUdmoImkFfJBVLnOycbxTqb%2BVlZPEMDrim5dQxJZxJe9kgnM4DsEA3OF0Tz423KXG5xZq2F6NtvfJ14nPRB%2F1Ya63gwO%2BDdd83t4Qe5CcJstAAAAA%3D%3D&config=H4sIAAAAAAAAA0WMTQrEIAxG75K1286id5hDBCctFv9IUhgR714tlu7C915ehUMsrBUyshCPS0pU%2FMMKZAOKZZcVTNf6tKEXagYUeScdiiyd%2BZSEJjUQXHRbGSWbQmYSeRHG3T9m66GQfucYKmjJdAc%2F0N7G%2FHPynaLySe0Cj9ke9LUAAAA%3D
Expected behavior
each number from 0 to 6 should be logged once as per const binding behaviors in ES6.
Version
1.2.119
Additional context
No response
The text was updated successfully, but these errors were encountered: