mirror of
https://github.com/hanzoai/babel.git
synced 2026-10-30 14:46:06 +00:00
20 lines
287 B
JavaScript
20 lines
287 B
JavaScript
const log = [];
|
|
|
|
async function* func1() {
|
|
log.push(1);
|
|
yield "a";
|
|
log.push(2);
|
|
}
|
|
|
|
async function* func2() {
|
|
yield* func1();
|
|
log.push(3);
|
|
}
|
|
|
|
return (async () => {
|
|
const iterator = func2();
|
|
await iterator.next();
|
|
await iterator.return();
|
|
|
|
expect(log).toEqual([1]);
|
|
})(); |