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 :) |
domenic
left a comment
There was a problem hiding this comment.
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.
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.
It looks like you shadowed an existing |promise| variable.
|
@bfgeek what do you think? |
|
This is now whatwg/html#4352. |
No description provided.