Skip to content

ModuleWrap::SyntheticModuleEvaluationStepsCallback should return a Promise #37299

@dandclark

Description

@dandclark

Top-level await expects that all module script evaluation returns a Promise. As such, ModuleWrap::SyntheticModuleEvaluationStepsCallback should be updated 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 Stage 1 Built-in modules proposal isn't yet updated for top-level await.

For reference, the corresponding change for Blink is https://chromium-review.googlesource.com/c/chromium/src/+/2568823.

I discovered this issue when working on this V8 bugfix: https://chromium-review.googlesource.com/c/v8/v8/+/2673794. My first attempt at a fix failed the Node integration tests because it assumed that the Synthetic Module callback steps return a Promise. For now, I'm adding a workaround for this in V8 but if Node can make this update then we'd like to eventually remove that workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.esmIssues and PRs related to the ECMAScript Modules implementation.experimentalIssues and PRs related to experimental features.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions