[Bug]: plugin-transform-async-to-generator incorrectly captures outer variable in a loop #15978
Labels
i: bug
i: regression
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
馃捇
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
Configuration file name
No response
Configuration
Current and expected behavior
With
@babel/helper-remap-async-to-generator@7.22.9
the output is1 2 3 4
(correct, expected).With
@babel/helper-remap-async-to-generator@7.22.17
the output is1 1 1 1
(incorrect, current).Also if the inner lambda has no arguments (the
x
argument is removed), the output changes to the correct1 2 3 4
in current version.I think this PR caused the regression: #15922
Environment
Possible solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: