Skip to content

Commit eaec35d

Browse files
tshemsedinovMylesBorins
authored andcommitted
doc: fix incorrect vm.createContext usage
In code example `vm.createContext` called with new operator by mistake. It is not a constructor. PR-URL: #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>
1 parent 83a2513 commit eaec35d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/vm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const sandbox = {
108108

109109
const script = new vm.Script('count += 1; name = "kitty";');
110110

111-
const context = new vm.createContext(sandbox);
111+
const context = vm.createContext(sandbox);
112112
for (let i = 0; i < 10; ++i) {
113113
script.runInContext(context);
114114
}

0 commit comments

Comments
 (0)