diff --git a/test/language/module-code/top-level-await/async-module-does-not-block-sibling-modules.js b/test/language/module-code/top-level-await/async-module-does-not-block-sibling-modules.js new file mode 100644 index 0000000000..709dc6fd54 --- /dev/null +++ b/test/language/module-code/top-level-await/async-module-does-not-block-sibling-modules.js @@ -0,0 +1,16 @@ +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-innermoduleevaluation +description: > + While an asynchronous module is waiting for a promise resolution, + sibling modules in the modules graph must be evaluated. +flags: [module, async] +features: [top-level-await] +---*/ + +import "./async-module-tla_FIXTURE.js"; +import { check } from "./async-module-sync_FIXTURE.js"; +assert.sameValue(check, false); +$DONE(); diff --git a/test/language/module-code/top-level-await/async-module-sync_FIXTURE.js b/test/language/module-code/top-level-await/async-module-sync_FIXTURE.js new file mode 100644 index 0000000000..67f815b3da --- /dev/null +++ b/test/language/module-code/top-level-await/async-module-sync_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export const { check } = globalThis; diff --git a/test/language/module-code/top-level-await/async-module-tla_FIXTURE.js b/test/language/module-code/top-level-await/async-module-tla_FIXTURE.js new file mode 100644 index 0000000000..309281782b --- /dev/null +++ b/test/language/module-code/top-level-await/async-module-tla_FIXTURE.js @@ -0,0 +1,6 @@ +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +globalThis.check = false; +await 0; +globalThis.check = true;