summaryrefslogtreecommitdiff
path: root/cli/tests/top_level_for_await.ts
blob: 9179322d78f4b1a884fba24f10f751b23054b577 (plain)
1
2
3
4
5
6
7
8
9
10
async function* asyncGenerator(): AsyncIterableIterator<number> {
  let i = 0;
  while (i < 3) {
    yield i++;
  }
}

for await (const num of asyncGenerator()) {
  console.log(num);
}