-
Notifications
You must be signed in to change notification settings - Fork 47
Conversation
Twin HTML PR whatwg/html#4352 |
spec.html
Outdated
@@ -70,7 +70,7 @@ <h1><ins>Runtime Semantics: HostImportModuleDynamically ( _referencingScriptOrMo | |||
|
|||
<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> |
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.
this would probably need to be specified in terms of an abstract op (like PromiseResolve
) rather than a global lookup
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.
Right, there's no intention of anyone doing such a dynamic lookup. This should not be taken literally.
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.) |
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
This was merged into the TLA spec, closing here |
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