diff --git a/crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-4486/1/exec.js b/crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-4486/1/exec.js new file mode 100644 index 00000000000..5898690e31a --- /dev/null +++ b/crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-4486/1/exec.js @@ -0,0 +1,26 @@ +const obj = { + a: 'a', + b: 'b', + c: 'c', + d: 'd', +} + +const wait = n => new Promise(r => setTimeout(r, n)) + +const action = async () => { + + for (let i in obj) { + + // halt for a second + await wait(1000) + + // this one is trouble + wait(1000).then(() => console.log(i)) + + } + + console.log('done') +} + + +action() \ No newline at end of file