summaryrefslogtreecommitdiff
path: root/cli/tests/top_level_await_bug2.js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/top_level_await_bug2.js')
-rw-r--r--cli/tests/top_level_await_bug2.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/tests/top_level_await_bug2.js b/cli/tests/top_level_await_bug2.js
new file mode 100644
index 000000000..c847bbd34
--- /dev/null
+++ b/cli/tests/top_level_await_bug2.js
@@ -0,0 +1,15 @@
+const mod = await import("./top_level_await_bug_nested.js");
+console.log(mod);
+
+const sleep = (n) => new Promise((r) => setTimeout(r, n));
+
+await sleep(100);
+console.log("slept");
+
+window.addEventListener("load", () => {
+ console.log("load event");
+});
+
+setTimeout(() => {
+ console.log("timeout");
+}, 1000);