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 25, 2017
1 parent 83a2513 commit eaec35d
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 @@ -108,7 +108,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 eaec35d

Please sign in to comment.