summaryrefslogtreecommitdiff
path: root/cli/tests/top_level_for_await.js
blob: 54742ce5208a74c2de34e5e8569212cbdffc6916 (plain)
1
2
3
4
5
6
7
8
9
10
function* asyncGenerator() {
  let i = 0;
  while (i < 3) {
    yield i++;
  }
}

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