-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
i: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
(async function () {
let items = [1, 2, 3, 4];
for (const item of items) {
await f(async (x) => {
console.log(item);
});
}
})();
async function f(lambda) {
await lambda();
}Configuration file name
No response
Configuration
{
"plugins": [
"@babel/plugin-transform-async-to-generator"
]
}Current and expected behavior
With @babel/helper-remap-async-to-generator@7.22.9 the output is 1 2 3 4 (correct, expected).
With @babel/helper-remap-async-to-generator@7.22.17 the output is 1 1 1 1 (incorrect, current).
Also if the inner lambda has no arguments (the x argument is removed), the output changes to the correct 1 2 3 4 in current version.
I think this PR caused the regression: #15922
Environment
- Babel version: 7.22.19
- Node: 18.10.0
- npm version: 9.7.2
- OS: Windows 11
- Monorepo: no
Possible solution
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
i: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue