mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
a1341dcdc6
swc_ecma_transforms_compat: - `async_to_generator`: Fix async iife. (#1722) - `async_to_generator`: Don't apply iife optimization to named function expressions. - `async_to_generator`: Remove duplicated works. - `async_to_generator`: Support `await for`. (#1721) - `async_to_generator`: Support async generators.
11 lines
151 B
JavaScript
11 lines
151 B
JavaScript
async function* lol() {
|
|
yield 1;
|
|
yield 2;
|
|
}
|
|
|
|
async function main() {
|
|
for await (const x of lol()) {
|
|
console.log(x);
|
|
}
|
|
}
|
|
main(); |