From e85cc8519021aae4babdcb62a2366cac14f227f9 Mon Sep 17 00:00:00 2001 From: sagirk Date: Fri, 20 Jul 2018 20:01:39 +0530 Subject: [PATCH] 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: https://github.com/nodejs/node/issues/21904 --- doc/api/vm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/vm.md b/doc/api/vm.md index 7d14293ac4e45b..f294e7301bd799 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -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.