-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Open
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
Description
https://nodejs.org/api/vm.html#vm_module_link_linker
Now we can only link "standard" modules with functions combined with SyntheticModules, like this:
await module.link( function( spec ) {
return new Promise( async function( resolve, reject ) {
const mod = await import( spec );
resolve( new vm.SyntheticModule( [ 'default' ], function() {
this.setExport( 'default', mod.default );
}, { context } ) );
} )
} );
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.