Skip to content

Commit

Permalink
doc: fix broken link in vm.md
Browse files Browse the repository at this point in the history
PR-URL: #7304
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Claudio Rodriguez <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
  • Loading branch information
lpinca authored and evanlucas committed Jun 27, 2016
1 parent 12fbac1 commit 08a9aa3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ added: v0.3.1
* `sandbox` {Object}

If given a `sandbox` object, the `vm.createContext()` method will [prepare
that sandbox][#vm_what_does_it_mean_to_contextify_an_object] so that it can be
used in calls to [`vm.runInContext()`][] or [`script.runInContext()`][]. Inside
such scripts, the `sandbox` object will be the global object, retaining all of
its existing properties but also having the built-in objects and functions any
standard [global object][] has. Outside of scripts run by the vm module,
`sandbox` will remain unchanged.
that sandbox][contextified] so that it can be used in calls to
[`vm.runInContext()`][] or [`script.runInContext()`][]. Inside such scripts,
the `sandbox` object will be the global object, retaining all of its existing
properties but also having the built-in objects and functions any standard
[global object][] has. Outside of scripts run by the vm module, `sandbox` will
remain unchanged.

If `sandbox` is omitted (or passed explicitly as `undefined`), a new, empty
[contextified][] sandbox object will be returned.
Expand Down Expand Up @@ -384,7 +384,7 @@ console.log('localVar: ', localVar);
Because `vm.runInThisContext()` does not have access to the local scope,
`localVar` is unchanged. In contrast, [`eval()`][] *does* have access to the
local scope, so the value `localVar` is changed. In this way
`vm.runInThisContext()` is much like an [indirect `eval()` call][], e.g.
`vm.runInThisContext()` is much like an [indirect `eval()` call][], e.g.
`(0,eval)('code')`.

## Example: Running an HTTP Server within a VM
Expand Down Expand Up @@ -415,7 +415,7 @@ let code =
})`;

vm.runInThisContext(code)(require);
```
```

*Note*: The `require()` in the above case shares the state with context it is
passed from. This may introduce risks when untrusted code is executed, e.g.
Expand Down

0 comments on commit 08a9aa3

Please sign in to comment.