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
If another loop (such as a basic for-loop or while-loop) is nested inside a for-of loop, the compiler doesn't recognize that the closure inside the inner loop closes over the outer loop variable.
**Description:**
The original code separately records the usage of variables and checks if there is a closure. Changed to only record variables used in a closure.
**Related issue:**
- Closes#8010
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
If another loop (such as a basic for-loop or while-loop) is nested inside a for-of loop, the compiler doesn't recognize that the closure inside the inner loop closes over the outer loop variable.
Input code
Config
Playground link
https://play.swc.rs/?version=1.3.89&code=H4sIAAAAAAAAAzWMTQqAIBQG957iWypGaNt%2BTtEuWoWGYD2oFwTh3dOg2cxmGE8H5EL7ybhBHpOpYCs0s8IjkPEliI4R0MO0WR1sltZ%2FUTgdj2FzdLGUCv2AsqTo6kirvJVqvzKJJF4nGb25cQAAAA%3D%3D&config=H4sIAAAAAAAAA1WPSw7DIAwF9zkF8rrbdtE79BAWdSIifrKJVBTl7iUE0maH3xsz8jooBbNoeKq1PMsQkYX4nEsi2Sf8lARIOxTNJia49XaWvRrRCtVoOxpIyBOluiX3hoMNQajjLXPGmzH%2FC3VwkUnkCu4o%2BsnSVTc0JbjwXmrZDkk50qF%2FwA%2FqsvNjMPLqm4kXGrYvhlQioBQBAAA%3D
SWC Info output
No response
Expected behavior
The code should print
Actual behavior
The code prints
Version
1.89
Additional context
No response
The text was updated successfully, but these errors were encountered: