Skip to content

Commit

Permalink
doc: fix incorrect vm.createContext usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tshemsedinov authored and MylesBorins committed Oct 11, 2017
1 parent 10622c6 commit 0ae84c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0ae84c2

Please sign in to comment.