summaryrefslogtreecommitdiff
path: root/cli/tests/top_level_for_await.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/top_level_for_await.ts')
-rw-r--r--cli/tests/top_level_for_await.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/top_level_for_await.ts b/cli/tests/top_level_for_await.ts
new file mode 100644
index 000000000..9179322d7
--- /dev/null
+++ b/cli/tests/top_level_for_await.ts
@@ -0,0 +1,10 @@
+async function* asyncGenerator(): AsyncIterableIterator<number> {
+ let i = 0;
+ while (i < 3) {
+ yield i++;
+ }
+}
+
+for await (const num of asyncGenerator()) {
+ console.log(num);
+}