Skip to content

vm: sync-ify SourceTextModule linkage#59000

Merged
nodejs-github-bot merged 2 commits intonodejs:mainfrom
legendecas:vm-module-link
Aug 29, 2025
Merged

vm: sync-ify SourceTextModule linkage#59000
nodejs-github-bot merged 2 commits intonodejs:mainfrom
legendecas:vm-module-link

Conversation

@legendecas
Copy link
Member

@legendecas legendecas commented Jul 8, 2025

Split module.link(linker) into two synchronous step
sourceTextModule.linkRequests() and
sourceTextModule.instantiate(). This allows creating vm modules and
resolving the dependencies in a complete synchronous procedure.

This also makes syntheticModule.link() redundant. The link step for a
SyntheticModule is no-op and is already taken care in the constructor
by initializing the binding slots with the given export names.

This also enables (static) source phase import in vm.SourceTextModules.

Refs: #37648

Loading
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. backported-to-v22.x PRs backported to the v22.x-staging branch. c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide SourceTextModule sync versions of link and evaluate methods

6 participants