Skip to content

Commit 4552cf7

Browse files
tshemsedinovaddaleax
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 <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
1 parent 2da7d9b commit 4552cf7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/vm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const sandbox = {
117117

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

120-
const context = new vm.createContext(sandbox);
120+
const context = vm.createContext(sandbox);
121121
for (let i = 0; i < 10; ++i) {
122122
script.runInContext(context);
123123
}

0 commit comments

Comments
 (0)