mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
135053486c
This commit changes implementation of top-level-await in "deno_core". Previously promise returned from module evaluation was not awaited, leading to out-of-order execution of modules that have TLA. It's been fixed by changing "JsRuntime::mod_evaluate" to be an async function that resolves when the promise returned from module evaluation also resolves. When waiting for promise resolution event loop is polled repeatedly, until there are no more dynamic imports or pending ops.
8 lines
178 B
JavaScript
8 lines
178 B
JavaScript
import { foo } from "./tla3/timeout_loop.js";
|
|
|
|
export const collection = [];
|
|
|
|
const mod = await import("./tla3/b.js");
|
|
|
|
console.log("foo in main", foo);
|
|
console.log("mod", mod);
|