Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

Ms2ger
Copy link

@Ms2ger Ms2ger commented Apr 24, 2020

No description provided.

@Ms2ger
Copy link
Author

Ms2ger commented Apr 24, 2020

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 :)

Copy link
Contributor

@domenic domenic left a 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|.
Copy link
Contributor

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|.
Copy link
Contributor

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.

@Ms2ger
Copy link
Author

Ms2ger commented Apr 27, 2020

@bfgeek what do you think?

@annevk
Copy link
Member

annevk commented Nov 20, 2020

This is now whatwg/html#4352.

@annevk annevk closed this Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants