From 0ae84c2434dfbd87a0284ddd4659fbc30b12311f Mon Sep 17 00:00:00 2001 From: tshemsedinov Date: Sat, 7 Oct 2017 03:28:37 +0300 Subject: [PATCH] doc: fix incorrect vm.createContext usage In code example `vm.createContext` called with new operator by mistake. It is not a constructor. PR-URL: https://github.com/nodejs/node/pull/16059 Reviewed-By: Anna Henningsen Reviewed-By: Timothy Gu Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: Minwoo Jung --- 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 dff10b17cf20fd..230054cba98bd2 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -117,7 +117,7 @@ const sandbox = { const script = new vm.Script('count += 1; name = "kitty";'); -const context = new vm.createContext(sandbox); +const context = vm.createContext(sandbox); for (let i = 0; i < 10; ++i) { script.runInContext(context); }