Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! bootstrap: include vm and contextify binding into the snapshot
  • Loading branch information
joyeecheung committed May 14, 2021
commit 0fa0bffca481d70febebc45a790c003585bb19f2
2 changes: 2 additions & 0 deletions lib/internal/bootstrap/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ function initializeESMLoader() {
setInitializeImportMetaObjectCallback(esm.initializeImportMetaObject);
setImportModuleDynamicallyCallback(esm.importModuleDynamicallyCallback);

// Patch the vm module when --experimental-vm-modules is on.
// Please update the comments in vm.js when this block changes.
if (getOptionValue('--experimental-vm-modules')) {
const {
Module, SourceTextModule, SyntheticModule,
Expand Down
4 changes: 4 additions & 0 deletions lib/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,7 @@ module.exports = {
compileFunction,
measureMemory,
};

// The vm module is patched to include vm.Module, vm.SourceTextModule
// and vm.SyntheticModule in the pre-execution phase when
// --experimental-vm-modules is on.