Skip to content

Commit

Permalink
doc: fix incorrect method invocation on vm.Module instance
Browse files Browse the repository at this point in the history
In the VM docs, under section `Constructor: new vm.Module`, the code
example incorrectly uses `module.initialize()`.

Change it to the correct method `module.instantiate()`.

Fixes: nodejs#21904
  • Loading branch information
sagirk committed Jul 20, 2018
1 parent c3f8dd6 commit e85cc85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const contextifiedSandbox = vm.createContext({ secret: 42 });
});
// Since module has no dependencies, the linker function will never be called.
await module.link(() => {});
module.initialize();
module.instantiate();
await module.evaluate();

// Now, Object.prototype.secret will be equal to 42.
Expand Down

0 comments on commit e85cc85

Please sign in to comment.