Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix incorrect method invocation on vm.Module instance #21911

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
doc: fix incorrect method invocation on vm.Module instance
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: #21904
  • Loading branch information
sagirk committed Jul 20, 2018
commit e85cc8519021aae4babdcb62a2366cac14f227f9
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