0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

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 <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
This commit is contained in:
tshemsedinov 2017-10-07 03:28:37 +03:00 committed by Anna Henningsen
parent 2da7d9b820
commit 4552cf774d
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -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);
}