Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eaec35d

Browse filesBrowse 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
Copy full SHA for eaec35d

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/vm.md‎

Copy file name to clipboardExpand all lines: doc/api/vm.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.