This repository was archived by the owner on Jan 25, 2022. It is now read-only.
[WIP] Top-level await integration#71
Closed
littledan wants to merge 2 commits into
Closed
Conversation
Member
Author
|
Twin HTML PR whatwg/html#4352 |
This was referenced Feb 10, 2019
ljharb
reviewed
Feb 10, 2019
| <dd> | ||
| <ul> | ||
| <li>At some future time, the host environment must perform FinishDynamicImport(_referencingScriptOrModule_, _specifier_, _promiseCapability_, NormalCompletion(*undefined*)).</li> | ||
| <li>At some future time, the host environment must perform FinishDynamicImport(_referencingScriptOrModule_, _specifier_, _promiseCapability_, Promise.resolve(*undefined*)).</li> |
Member
There was a problem hiding this comment.
this would probably need to be specified in terms of an abstract op (like PromiseResolve) rather than a global lookup
Member
Author
There was a problem hiding this comment.
Right, there's no intention of anyone doing such a dynamic lookup. This should not be taken literally.
Member
Author
|
Unnecessary with the current phrasing of whatwg/html#4352 . (The logic is extremely trivial either way, as you can see from that patch, so I don't think there's much for us to pull back here into JS.) |
Member
Author
|
Reopening, as I'm reverting that patch. |
The purpose of this patch is to nail down how dynamic import would adjust to the needs of top-level await. The relevant change is, the module.Evaluate() method will return a Promise that resolves when the module is ready, and this will be passed to FinishDynamicImport to wait on before resolving the Promise it returns. This PR is just a sketch, not to be landed. For one, the "Upon fulfillment" language will need to be changed to be more ECMASpeak-like. Top-level await should also reach stage 3 before this change lands. The PR where Evaluate returns a Promise is guybedford/proposal-top-level-await#1
6132aaa to
f10a46a
Compare
3 tasks
|
This was merged into the TLA spec, closing here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The purpose of this patch is to nail down how dynamic import would
adjust to the needs of top-level await. The relevant change is,
the module.Evaluate() method will return a Promise that resolves
when the module is ready, and this will be passed to
FinishDynamicImport to wait on before resolving the Promise it returns.
This PR is just a sketch, not to be landed. For one, the "Upon fulfillment"
language will need to be changed to be more ECMASpeak-like. Top-level
await should also reach stage 3 before this change lands.
The PR where Evaluate returns a Promise is
guybedford/proposal-top-level-await#1