-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle module scripts that include top-level await. #984
Conversation
This is in response to whatwg/html#4352. @domenic , I'm not sure if this is what we want in terms of behavior, but it's a change, at least :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! We may need the worklet editors for the semantic question of whether to run the scripts sequentially or not...
6. Run the <a>responsible event loop</a> specified by |insideSettings|. | ||
9. [=Wait for all=] |scripts|, with success steps and failure steps both given by: | ||
|
||
1. Run the <a>responsible event loop</a> specified by |insideSettings|. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this isn't right. Without an inner event loop, the microtask queue (and thus any awaits) cannot run.
I see two possible semantics here:
- Ignore the promises returned; their errors will be reported appropriately, and that's all one would do with them.
- Run the module scripts "sequentially", waiting for one to complete (i.e. the promise to settle) before moving on to the next.
I think the first of these is probably more correct, since (IIRC) it aligns with what happens if you have multiple TLA-using <script type=module>
s.
2. If |pendingTaskStruct|'s <a for="pending tasks struct">counter</a> is <b>0</b>, then | ||
resolve |promise|. | ||
2. If |pendingTaskStruct|'s <a for="pending tasks struct">counter</a> is <b>0</b>, then | ||
resolve |promise|. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you shadowed an existing |promise| variable.
@bfgeek what do you think? |
This is now whatwg/html#4352. |
No description provided.