mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +00:00
LibJS: Add basic support for module code with top-level await
For now, we handle this by creating a synthetic async function to wrap the top-level module code. This allows us to piggyback on the async function driver wrapper mechanism.
This commit is contained in:
parent
26c21fba8e
commit
a2c3db8367
4 changed files with 35 additions and 3 deletions
|
@ -40,7 +40,7 @@ describe("normal behavior", () => {
|
|||
expect(passed).toBeTrue();
|
||||
});
|
||||
|
||||
test.xfail("value from async module", () => {
|
||||
test("value from async module", () => {
|
||||
const shadowRealm = new ShadowRealm();
|
||||
const promise = shadowRealm.importValue("./async-module.mjs", "foo");
|
||||
expect(promise).toBeInstanceOf(Promise);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue