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

[WIP] Top-level await integration #71

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@littledan
Copy link
Member

littledan commented Feb 10, 2019

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

[WIP] Top-level await integration
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
@littledan

This comment has been minimized.

Copy link
Member Author

littledan commented Feb 10, 2019

Twin HTML PR whatwg/html#4352

@@ -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>

This comment has been minimized.

@ljharb

ljharb Feb 10, 2019

Member

this would probably need to be specified in terms of an abstract op (like PromiseResolve) rather than a global lookup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment