From c7c767782538243ded64742dca9b34d6af74d62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 6 Oct 2020 10:18:22 +0200 Subject: fix(core): module execution with top level await (#7672) This commit fixes implementation of top level await in "deno_core". Previously promise returned from module execution was ignored causing to execute modules out-of-order. With this commit promise returned from module execution is stored on "JsRuntime" and event loop is polled until the promise resolves. --- cli/tests/top_level_await_bug.js | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 cli/tests/top_level_await_bug.js (limited to 'cli/tests/top_level_await_bug.js') diff --git a/cli/tests/top_level_await_bug.js b/cli/tests/top_level_await_bug.js new file mode 100644 index 000000000..3c6860a5b --- /dev/null +++ b/cli/tests/top_level_await_bug.js @@ -0,0 +1,2 @@ +const mod = await import("./top_level_await_bug_nested.js"); +console.log(mod); -- cgit v1.2.3