Add test for async module not blocking sync siblings (#3955)

This commit is contained in:
Nicolò Ribaudo 2024-02-21 14:53:10 +01:00 committed by GitHub
parent 45e740928f
commit c0e8eef81b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 0 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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;