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 <[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]>
  • 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.