Skip to content

Commit 16f98e5

Browse files
committed
doc: add added: information for vm
Ref: #6578 PR-URL: #7011 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Julian Duque <[email protected]>
1 parent 51b8a79 commit 16f98e5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

doc/api/vm.md

+30
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ JavaScript code can be compiled and run immediately or compiled, saved, and run
1515
later.
1616

1717
## Class: vm.Script
18+
<!-- YAML
19+
added: v0.3.1
20+
-->
1821

1922
Instances of the `vm.Script` class contain precompiled scripts that can be
2023
executed in specific sandboxes (or "contexts").
2124

2225
### new vm.Script(code, options)
26+
<!-- YAML
27+
added: v0.3.1
28+
-->
2329

2430
* `code` {string} The JavaScript code to compile.
2531
* `options`
@@ -52,6 +58,9 @@ that the `code` is not bound to any global object; rather, it is bound before
5258
each run, just for that run.
5359

5460
### script.runInContext(contextifiedSandbox[, options])
61+
<!-- YAML
62+
added: v0.3.1
63+
-->
5564

5665
* `contextifiedSandbox` {Object} A [contextified][] object as returned by the
5766
`vm.createContext()` method.
@@ -99,6 +108,9 @@ console.log(util.inspect(sandbox));
99108
```
100109

101110
### script.runInNewContext([sandbox][, options])
111+
<!-- YAML
112+
added: v0.3.1
113+
-->
102114

103115
* `sandbox` {Object} An object that will be [contextified][]. If `undefined`, a
104116
new object will be created.
@@ -141,6 +153,9 @@ console.log(util.inspect(sandboxes));
141153
```
142154

143155
### script.runInThisContext([options])
156+
<!-- YAML
157+
added: v0.3.1
158+
-->
144159

145160
* `options` {Object}
146161
* `filename` {string} Specifies the filename used in stack traces produced
@@ -180,6 +195,9 @@ console.log(globalVar);
180195
```
181196

182197
## vm.createContext([sandbox])
198+
<!-- YAML
199+
added: v0.3.1
200+
-->
183201

184202
* `sandbox` {Object}
185203

@@ -201,6 +219,9 @@ window's global object, then run all `<script>` tags together within the context
201219
of that sandbox.
202220

203221
## vm.isContext(sandbox)
222+
<!-- YAML
223+
added: v0.11.7
224+
-->
204225

205226
* `sandbox` {Object}
206227

@@ -250,6 +271,9 @@ console.log(util.inspect(sandbox));
250271
```
251272

252273
## vm.runInDebugContext(code)
274+
<!-- YAML
275+
added: v0.11.14
276+
-->
253277

254278
* `code` {string} The JavaScript code to compile and run.
255279

@@ -270,6 +294,9 @@ The `Debug` object can also be made available using the V8-specific
270294
`--expose_debug_as=` [command line option][cli.md].
271295

272296
## vm.runInNewContext(code[, sandbox][, options])
297+
<!-- YAML
298+
added: v0.3.1
299+
-->
273300

274301
* `code` {string} The JavaScript code to compile and run.
275302
* `sandbox` {Object} An object that will be [contextified][]. If `undefined`, a
@@ -312,6 +339,9 @@ console.log(util.inspect(sandbox));
312339
```
313340

314341
## vm.runInThisContext(code[, options])
342+
<!-- YAML
343+
added: v0.3.1
344+
-->
315345

316346
* `code` {string} The JavaScript code to compile and run.
317347
* `options`

0 commit comments

Comments
 (0)