From 216a3cdcced4fa0bbc3c31a7529854cee0c5dec9 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 27 May 2016 04:21:30 +0200 Subject: [PATCH] doc: add `added:` information for vm Ref: https://github.com/nodejs/node/issues/6578 PR-URL: https://github.com/nodejs/node/pull/7011 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Julian Duque --- doc/api/vm.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/doc/api/vm.md b/doc/api/vm.md index 8de2775dccb802..d49081c481d533 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -15,11 +15,17 @@ JavaScript code can be compiled and run immediately or compiled, saved, and run later. ## Class: vm.Script + Instances of the `vm.Script` class contain precompiled scripts that can be executed in specific sandboxes (or "contexts"). ### new vm.Script(code, options) + * `code` {string} The JavaScript code to compile. * `options` @@ -52,6 +58,9 @@ that the `code` is not bound to any global object; rather, it is bound before each run, just for that run. ### script.runInContext(contextifiedSandbox[, options]) + * `contextifiedSandbox` {Object} A [contextified][] object as returned by the `vm.createContext()` method. @@ -99,6 +108,9 @@ console.log(util.inspect(sandbox)); ``` ### script.runInNewContext([sandbox][, options]) + * `sandbox` {Object} An object that will be [contextified][]. If `undefined`, a new object will be created. @@ -141,6 +153,9 @@ console.log(util.inspect(sandboxes)); ``` ### script.runInThisContext([options]) + * `options` {Object} * `filename` {string} Specifies the filename used in stack traces produced @@ -180,6 +195,9 @@ console.log(globalVar); ``` ## vm.createContext([sandbox]) + * `sandbox` {Object} @@ -201,6 +219,9 @@ window's global object, then run all `