Bug 264400 - Modules with top-level await should not block execution of sibling modules
Summary: Modules with top-level await should not block execution of sibling modules
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 17
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-11-08 04:32 PST by nicolo.ribaudo
Modified: 2023-11-15 04:33 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nicolo.ribaudo 2023-11-08 04:32:21 PST
Consider the following module:

    import "a"
    import "b"

and assume that "a" uses top-level await. The expected execution order is:
1. "a" starts executing, and then pauses at the await
2. "b" gets executed
3. at some point, "a" finishes executing

However, this is what is currently happening in Safari:
1. "a" starts executing, and then pauses at the await
2. at some point, "a" finishes executing
3. then "b" gets executed

I submitted a WPT test for this at https://github.com/web-platform-tests/wpt/pull/42944
Comment 1 Radar WebKit Bug Importer 2023-11-15 04:33:13 PST
<rdar://problem/118449289>