Skip to content

Commit b6e892b

Browse files
TrottMylesBorins
authored andcommitted
doc,vm: use code markup/markdown in headers
Backport-PR-URL: #31108 PR-URL: #31086 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 36b3e15 commit b6e892b

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

doc/api/vm.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ console.log(sandbox.y); // 17
4343
console.log(x); // 1; y is not defined.
4444
```
4545

46-
## Class: vm.Script
46+
## Class: `vm.Script`
4747
<!-- YAML
4848
added: v0.3.1
4949
-->
5050

5151
Instances of the `vm.Script` class contain precompiled scripts that can be
5252
executed in specific sandboxes (or "contexts").
5353

54-
### Constructor: new vm.Script(code\[, options\])
54+
### Constructor: `new vm.Script(code[, options])`
5555
<!-- YAML
5656
added: v0.3.1
5757
changes:
@@ -103,7 +103,7 @@ Creating a new `vm.Script` object compiles `code` but does not run it. The
103103
compiled `vm.Script` can be run later multiple times. The `code` is not bound to
104104
any global object; rather, it is bound before each run, just for that run.
105105

106-
### script.createCachedData()
106+
### `script.createCachedData()`
107107
<!-- YAML
108108
added: v10.6.0
109109
-->
@@ -130,7 +130,7 @@ script.runInThisContext();
130130
const cacheWithX = script.createCachedData();
131131
```
132132

133-
### script.runInContext(contextifiedSandbox\[, options\])
133+
### `script.runInContext(contextifiedSandbox[, options])`
134134
<!-- YAML
135135
added: v0.3.1
136136
changes:
@@ -188,7 +188,7 @@ Using the `timeout` or `breakOnSigint` options will result in new event loops
188188
and corresponding threads being started, which have a non-zero performance
189189
overhead.
190190

191-
### script.runInNewContext(\[sandbox\[, options\]\])
191+
### `script.runInNewContext([sandbox[, options]])`
192192
<!-- YAML
193193
added: v0.3.1
194194
changes:
@@ -255,7 +255,7 @@ console.log(util.inspect(sandboxes));
255255
// [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]
256256
```
257257

258-
### script.runInThisContext(\[options\])
258+
### `script.runInThisContext([options])`
259259
<!-- YAML
260260
added: v0.3.1
261261
changes:
@@ -301,7 +301,7 @@ console.log(globalVar);
301301
// 1000
302302
```
303303

304-
## Class: vm.SourceTextModule
304+
## Class: `vm.SourceTextModule`
305305
<!-- YAML
306306
added: v9.6.0
307307
-->
@@ -404,7 +404,7 @@ const contextifiedSandbox = vm.createContext({ secret: 42 });
404404
})();
405405
```
406406

407-
### Constructor: new vm.SourceTextModule(code\[, options\])
407+
### Constructor: `new vm.SourceTextModule(code[, options])`
408408

409409
* `code` {string} JavaScript Module code to parse
410410
* `options`
@@ -468,7 +468,7 @@ const contextifiedSandbox = vm.createContext({ secret: 42 });
468468
})();
469469
```
470470

471-
### module.dependencySpecifiers
471+
### `module.dependencySpecifiers`
472472

473473
* {string[]}
474474

@@ -478,7 +478,7 @@ to disallow any changes to it.
478478
Corresponds to the `[[RequestedModules]]` field of
479479
[Source Text Module Record][]s in the ECMAScript specification.
480480

481-
### module.error
481+
### `module.error`
482482

483483
* {any}
484484

@@ -492,7 +492,7 @@ exception due to possible ambiguity with `throw undefined;`.
492492
Corresponds to the `[[EvaluationError]]` field of [Source Text Module Record][]s
493493
in the ECMAScript specification.
494494

495-
### module.evaluate(\[options\])
495+
### `module.evaluate([options])`
496496

497497
* `options` {Object}
498498
* `timeout` {integer} Specifies the number of milliseconds to evaluate
@@ -522,7 +522,7 @@ This method cannot be called while the module is being evaluated
522522
Corresponds to the [Evaluate() concrete method][] field of [Source Text Module
523523
Record][]s in the ECMAScript specification.
524524

525-
### module.link(linker)
525+
### `module.link(linker)`
526526

527527
* `linker` {Function}
528528
* `specifier` {string} The specifier of the requested module:
@@ -571,7 +571,7 @@ specification.
571571
Corresponds to the [Link() concrete method][] field of [Source Text Module
572572
Record][]s in the ECMAScript specification.
573573

574-
### module.namespace
574+
### `module.namespace`
575575

576576
* {Object}
577577

@@ -581,7 +581,7 @@ The namespace object of the module. This is only available after linking
581581
Corresponds to the [GetModuleNamespace][] abstract operation in the ECMAScript
582582
specification.
583583

584-
### module.status
584+
### `module.status`
585585

586586
* {string}
587587

@@ -607,13 +607,13 @@ Other than `'errored'`, this status string corresponds to the specification's
607607
`'evaluated'` in the specification, but with `[[EvaluationError]]` set to a
608608
value that is not `undefined`.
609609

610-
### module.identifier
610+
### `module.identifier`
611611

612612
* {string}
613613

614614
The identifier of the current module, as set in the constructor.
615615

616-
## vm.compileFunction(code\[, params\[, options\]\])
616+
## `vm.compileFunction(code[, params[, options]])`
617617
<!-- YAML
618618
added: v10.10.0
619619
-->
@@ -644,7 +644,7 @@ Compiles the given code into the provided context/sandbox (if no context is
644644
supplied, the current context is used), and returns it wrapped inside a
645645
function with the given `params`.
646646

647-
## vm.createContext(\[sandbox\[, options\]\])
647+
## `vm.createContext([sandbox[, options]])`
648648
<!-- YAML
649649
added: v0.3.1
650650
changes:
@@ -711,7 +711,7 @@ of that sandbox.
711711
The provided `name` and `origin` of the context are made visible through the
712712
Inspector API.
713713
714-
## vm.isContext(sandbox)
714+
## `vm.isContext(sandbox)`
715715
<!-- YAML
716716
added: v0.11.7
717717
-->
@@ -722,7 +722,7 @@ added: v0.11.7
722722
Returns `true` if the given `sandbox` object has been [contextified][] using
723723
[`vm.createContext()`][].
724724
725-
## vm.runInContext(code, contextifiedSandbox\[, options\])
725+
## `vm.runInContext(code, contextifiedSandbox[, options])`
726726
<!-- YAML
727727
added: v0.3.1
728728
changes:
@@ -802,7 +802,7 @@ console.log(util.inspect(sandbox));
802802
// { globalVar: 1024 }
803803
```
804804
805-
## vm.runInNewContext(code\[, sandbox\[, options\]\])
805+
## `vm.runInNewContext(code[, sandbox[, options]])`
806806
<!-- YAML
807807
added: v0.3.1
808808
changes:
@@ -900,7 +900,7 @@ console.log(util.inspect(sandbox));
900900
// { animal: 'cat', count: 3, name: 'kitty' }
901901
```
902902
903-
## vm.runInThisContext(code\[, options\])
903+
## `vm.runInThisContext(code[, options])`
904904
<!-- YAML
905905
added: v0.3.1
906906
changes:
@@ -1035,7 +1035,7 @@ within which it can operate. The process of creating the V8 Context and
10351035
associating it with the `sandbox` object is what this document refers to as
10361036
"contextifying" the `sandbox`.
10371037

1038-
## Timeout limitations when using process.nextTick(), Promises, and queueMicrotask()
1038+
## Timeout limitations when using `process.nextTick()`, Promises, and `queueMicrotask()`
10391039

10401040
Because of the internal mechanics of how the `process.nextTick()` queue and
10411041
the microtask queue that underlies Promises are implemented within V8 and

0 commit comments

Comments
 (0)