diff options
author | Luigi Pinca <luigipinca@gmail.com> | 2016-06-15 08:09:16 +0200 |
---|---|---|
committer | silverwind <me@silverwind.io> | 2016-06-17 22:25:30 +0200 |
commit | de9a84186e6da9e4e6ee9434aa89715bf3eb9172 (patch) | |
tree | f75f723d177d9b837da8d08e2bc64c64abb13d99 /doc/api/vm.md | |
parent | 9dfc8b9d8e2f06903915aedfe531d0c9107f986a (diff) | |
download | android-node-v8-de9a84186e6da9e4e6ee9434aa89715bf3eb9172.tar.gz android-node-v8-de9a84186e6da9e4e6ee9434aa89715bf3eb9172.tar.bz2 android-node-v8-de9a84186e6da9e4e6ee9434aa89715bf3eb9172.zip |
doc: fix broken link in vm.md
PR-URL: https://github.com/nodejs/node/pull/7304
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'doc/api/vm.md')
-rw-r--r-- | doc/api/vm.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/api/vm.md b/doc/api/vm.md index d49081c481..b65826b2d3 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -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. @@ -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 @@ -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. |