Skip to content

Commit e6fbde5

Browse files
TrottBridgeAR
authored andcommitted
doc,vm: use code markup/markdown in headers
PR-URL: #31086 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent cb3c3fc commit e6fbde5

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

doc/api/vm.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ console.log(context.y); // 17
4040
console.log(x); // 1; y is not defined.
4141
```
4242

43-
## Class: vm.Script
43+
## Class: `vm.Script`
4444
<!-- YAML
4545
added: v0.3.1
4646
-->
4747

4848
Instances of the `vm.Script` class contain precompiled scripts that can be
4949
executed in specific contexts.
5050

51-
### Constructor: new vm.Script(code\[, options\])
51+
### Constructor: `new vm.Script(code[, options])`
5252
<!-- YAML
5353
added: v0.3.1
5454
changes:
@@ -99,7 +99,7 @@ Creating a new `vm.Script` object compiles `code` but does not run it. The
9999
compiled `vm.Script` can be run later multiple times. The `code` is not bound to
100100
any global object; rather, it is bound before each run, just for that run.
101101

102-
### script.createCachedData()
102+
### `script.createCachedData()`
103103
<!-- YAML
104104
added: v10.6.0
105105
-->
@@ -126,7 +126,7 @@ script.runInThisContext();
126126
const cacheWithX = script.createCachedData();
127127
```
128128

129-
### script.runInContext(contextifiedObject\[, options\])
129+
### `script.runInContext(contextifiedObject[, options])`
130130
<!-- YAML
131131
added: v0.3.1
132132
changes:
@@ -184,7 +184,7 @@ Using the `timeout` or `breakOnSigint` options will result in new event loops
184184
and corresponding threads being started, which have a non-zero performance
185185
overhead.
186186

187-
### script.runInNewContext(\[contextObject\[, options\]\])
187+
### `script.runInNewContext([contextObject[, options]])`
188188
<!-- YAML
189189
added: v0.3.1
190190
changes:
@@ -251,7 +251,7 @@ console.log(util.inspect(contexts));
251251
// [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]
252252
```
253253

254-
### script.runInThisContext(\[options\])
254+
### `script.runInThisContext([options])`
255255
<!-- YAML
256256
added: v0.3.1
257257
changes:
@@ -297,7 +297,7 @@ console.log(globalVar);
297297
// 1000
298298
```
299299

300-
## Class: vm.Module
300+
## Class: `vm.Module`
301301
<!-- YAML
302302
added: v13.0.0
303303
-->
@@ -400,7 +400,7 @@ const contextifiedObject = vm.createContext({ secret: 42 });
400400
})();
401401
```
402402

403-
### module.dependencySpecifiers
403+
### `module.dependencySpecifiers`
404404

405405
* {string[]}
406406

@@ -410,7 +410,7 @@ to disallow any changes to it.
410410
Corresponds to the `[[RequestedModules]]` field of [Cyclic Module Record][]s in
411411
the ECMAScript specification.
412412

413-
### module.error
413+
### `module.error`
414414

415415
* {any}
416416

@@ -424,7 +424,7 @@ exception due to possible ambiguity with `throw undefined;`.
424424
Corresponds to the `[[EvaluationError]]` field of [Cyclic Module Record][]s
425425
in the ECMAScript specification.
426426

427-
### module.evaluate(\[options\])
427+
### `module.evaluate([options])`
428428

429429
* `options` {Object}
430430
* `timeout` {integer} Specifies the number of milliseconds to evaluate
@@ -454,7 +454,7 @@ This method cannot be called while the module is being evaluated
454454
Corresponds to the [Evaluate() concrete method][] field of [Cyclic Module
455455
Record][]s in the ECMAScript specification.
456456

457-
### module.link(linker)
457+
### `module.link(linker)`
458458

459459
* `linker` {Function}
460460
* `specifier` {string} The specifier of the requested module:
@@ -502,7 +502,7 @@ specification.
502502
Corresponds to the [Link() concrete method][] field of [Cyclic Module
503503
Record][]s in the ECMAScript specification.
504504

505-
### module.namespace
505+
### `module.namespace`
506506

507507
* {Object}
508508

@@ -512,7 +512,7 @@ The namespace object of the module. This is only available after linking
512512
Corresponds to the [GetModuleNamespace][] abstract operation in the ECMAScript
513513
specification.
514514

515-
### module.status
515+
### `module.status`
516516

517517
* {string}
518518

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

541-
### module.identifier
541+
### `module.identifier`
542542

543543
* {string}
544544

545545
The identifier of the current module, as set in the constructor.
546546

547-
## Class: vm.SourceTextModule
547+
## Class: `vm.SourceTextModule`
548548
<!-- YAML
549549
added: v9.6.0
550550
-->
@@ -559,7 +559,7 @@ flag enabled.*
559559
The `vm.SourceTextModule` class provides the [Source Text Module Record][] as
560560
defined in the ECMAScript specification.
561561

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

564564
* `code` {string} JavaScript Module code to parse
565565
* `options`
@@ -621,7 +621,7 @@ const contextifiedObject = vm.createContext({ secret: 42 });
621621
})();
622622
```
623623
624-
## Class: vm.SyntheticModule
624+
## Class: `vm.SyntheticModule`
625625
<!-- YAML
626626
added: v13.0.0
627627
-->
@@ -650,7 +650,7 @@ const module = new vm.SyntheticModule(['default'], function() {
650650
// Use `module` in linking...
651651
```
652652
653-
### Constructor: new vm.SyntheticModule(exportNames, evaluateCallback\[, options\])
653+
### Constructor: `new vm.SyntheticModule(exportNames, evaluateCallback[, options])`
654654
<!-- YAML
655655
added: v13.0.0
656656
-->
@@ -670,7 +670,7 @@ Objects assigned to the exports of this instance may allow importers of
670670
the module to access information outside the specified `context`. Use
671671
`vm.runInContext()` to create objects in a specific context.
672672
673-
### syntheticModule.setExport(name, value)
673+
### `syntheticModule.setExport(name, value)`
674674
<!-- YAML
675675
added: v13.0.0
676676
-->
@@ -697,7 +697,7 @@ const vm = require('vm');
697697
})();
698698
```
699699
700-
## vm.compileFunction(code\[, params\[, options\]\])
700+
## `vm.compileFunction(code[, params[, options]])`
701701
<!-- YAML
702702
added: v10.10.0
703703
-->
@@ -728,7 +728,7 @@ Compiles the given code into the provided context (if no context is
728728
supplied, the current context is used), and returns it wrapped inside a
729729
function with the given `params`.
730730
731-
## vm.createContext(\[contextObject\[, options\]\])
731+
## `vm.createContext([contextObject[, options]])`
732732
<!-- YAML
733733
added: v0.3.1
734734
changes:
@@ -795,7 +795,7 @@ context.
795795
The provided `name` and `origin` of the context are made visible through the
796796
Inspector API.
797797
798-
## vm.isContext(object)
798+
## `vm.isContext(object)`
799799
<!-- YAML
800800
added: v0.11.7
801801
-->
@@ -806,7 +806,7 @@ added: v0.11.7
806806
Returns `true` if the given `oject` object has been [contextified][] using
807807
[`vm.createContext()`][].
808808
809-
## vm.runInContext(code, contextifiedObject\[, options\])
809+
## `vm.runInContext(code, contextifiedObject[, options])`
810810
<!-- YAML
811811
added: v0.3.1
812812
changes:
@@ -885,7 +885,7 @@ console.log(util.inspect(contextObject));
885885
// { globalVar: 1024 }
886886
```
887887
888-
## vm.runInNewContext(code\[, contextObject\[, options\]\])
888+
## `vm.runInNewContext(code[, contextObject[, options]])`
889889
<!-- YAML
890890
added: v0.3.1
891891
changes:
@@ -982,7 +982,7 @@ console.log(util.inspect(contextObject));
982982
// { animal: 'cat', count: 3, name: 'kitty' }
983983
```
984984
985-
## vm.runInThisContext(code\[, options\])
985+
## `vm.runInThisContext(code[, options])`
986986
<!-- YAML
987987
added: v0.3.1
988988
changes:
@@ -1116,7 +1116,7 @@ within which it can operate. The process of creating the V8 Context and
11161116
associating it with the `contextObject` is what this document refers to as
11171117
"contextifying" the object.
11181118
1119-
## Timeout limitations when using process.nextTick(), Promises, and queueMicrotask()
1119+
## Timeout limitations when using `process.nextTick()`, Promises, and `queueMicrotask()`
11201120
11211121
Because of the internal mechanics of how the `process.nextTick()` queue and
11221122
the microtask queue that underlies Promises are implemented within V8 and

0 commit comments

Comments
 (0)