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

module: make synthetic module evaluation steps return a Promise to support top level await #37300

Conversation

dandclark
Copy link
Contributor

Top level await expects that all module script evaluation returns a
Promise. As such, update
ModuleWrap::SyntheticModuleEvaluationStepsCallback to return a
resolved Promise now that V8 has enabled top-level await by default.

Unfortunately I don't have a spec reference that I can point to other
than https://tc39.es/proposal-top-level-await/ because the built-in
modules proposal isn't yet updated for top level await.

The corresponding change for Blink is
https://chromium-review.googlesource.com/c/chromium/src/+/2568823.

Resolves #37299

…pport top level await

Top level await expects that all module script evaluation returns a
Promise. As such, update
ModuleWrap::SyntheticModuleEvaluationStepsCallback to return a
resolved Promise now that V8 has enabled top-level await by default.

Unfortunately I don't have a spec reference that I can point to here
because the Built-in modules proposal isn't yet updated for
top level await.

The corresponding change for Blink is
https://chromium-review.googlesource.com/c/chromium/src/+/2568823.

This will allow a workaround for Node in this V8 bugfix to be removed:
https://chromium-review.googlesource.com/c/v8/v8/+/2673794.

Fixes: nodejs#37299
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Feb 9, 2021
@aduh95 aduh95 requested a review from devsnek February 9, 2021 21:42
@devsnek devsnek added esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features. labels Feb 9, 2021
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 9, 2021
@aduh95
Copy link
Contributor

aduh95 commented Feb 10, 2021

Does this has any effect on the public vm API?

@devsnek
Copy link
Member

devsnek commented Feb 10, 2021

nope

@devsnek
Copy link
Member

devsnek commented Feb 12, 2021

landed in 521c08d

@devsnek devsnek closed this Feb 12, 2021
devsnek pushed a commit that referenced this pull request Feb 12, 2021
…pport top level await

Top level await expects that all module script evaluation returns a
Promise. As such, update
ModuleWrap::SyntheticModuleEvaluationStepsCallback to return a
resolved Promise now that V8 has enabled top-level await by default.

Unfortunately I don't have a spec reference that I can point to here
because the Built-in modules proposal isn't yet updated for
top level await.

The corresponding change for Blink is
https://chromium-review.googlesource.com/c/chromium/src/+/2568823.

This will allow a workaround for Node in this V8 bugfix to be removed:
https://chromium-review.googlesource.com/c/v8/v8/+/2673794.

Fixes: #37299

PR-URL: #37300
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
…pport top level await

Top level await expects that all module script evaluation returns a
Promise. As such, update
ModuleWrap::SyntheticModuleEvaluationStepsCallback to return a
resolved Promise now that V8 has enabled top-level await by default.

Unfortunately I don't have a spec reference that I can point to here
because the Built-in modules proposal isn't yet updated for
top level await.

The corresponding change for Blink is
https://chromium-review.googlesource.com/c/chromium/src/+/2568823.

This will allow a workaround for Node in this V8 bugfix to be removed:
https://chromium-review.googlesource.com/c/v8/v8/+/2673794.

Fixes: #37299

PR-URL: #37300
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
This was referenced Feb 16, 2021
@ai
Copy link

ai commented Feb 23, 2021

@devsnek Node.js 15.10 still has this issue. Did your fix was released in 15.10?

targos pushed a commit that referenced this pull request May 1, 2021
…pport top level await

Top level await expects that all module script evaluation returns a
Promise. As such, update
ModuleWrap::SyntheticModuleEvaluationStepsCallback to return a
resolved Promise now that V8 has enabled top-level await by default.

Unfortunately I don't have a spec reference that I can point to here
because the Built-in modules proposal isn't yet updated for
top level await.

The corresponding change for Blink is
https://chromium-review.googlesource.com/c/chromium/src/+/2568823.

This will allow a workaround for Node in this V8 bugfix to be removed:
https://chromium-review.googlesource.com/c/v8/v8/+/2673794.

Fixes: #37299

PR-URL: #37300
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ModuleWrap::SyntheticModuleEvaluationStepsCallback should return a Promise
6 participants