@@ -43,15 +43,15 @@ console.log(sandbox.y); // 17 |
43 | 43 | console.log(x); // 1; y is not defined. |
44 | 44 | ``` |
45 | 45 |
|
46 | | -## Class: vm.Script |
| 46 | +## Class: `vm.Script` |
47 | 47 | <!-- YAML |
48 | 48 | added: v0.3.1 |
49 | 49 | --> |
50 | 50 |
|
51 | 51 | Instances of the `vm.Script` class contain precompiled scripts that can be |
52 | 52 | executed in specific sandboxes (or "contexts"). |
53 | 53 |
|
54 | | -### Constructor: new vm.Script(code\[, options\]) |
| 54 | +### Constructor: `new vm.Script(code[, options])` |
55 | 55 | <!-- YAML |
56 | 56 | added: v0.3.1 |
57 | 57 | changes: |
@@ -103,7 +103,7 @@ Creating a new `vm.Script` object compiles `code` but does not run it. The |
103 | 103 | compiled `vm.Script` can be run later multiple times. The `code` is not bound to |
104 | 104 | any global object; rather, it is bound before each run, just for that run. |
105 | 105 |
|
106 | | -### script.createCachedData() |
| 106 | +### `script.createCachedData()` |
107 | 107 | <!-- YAML |
108 | 108 | added: v10.6.0 |
109 | 109 | --> |
@@ -130,7 +130,7 @@ script.runInThisContext(); |
130 | 130 | const cacheWithX = script.createCachedData(); |
131 | 131 | ``` |
132 | 132 |
|
133 | | -### script.runInContext(contextifiedSandbox\[, options\]) |
| 133 | +### `script.runInContext(contextifiedSandbox[, options])` |
134 | 134 | <!-- YAML |
135 | 135 | added: v0.3.1 |
136 | 136 | changes: |
@@ -188,7 +188,7 @@ Using the `timeout` or `breakOnSigint` options will result in new event loops |
188 | 188 | and corresponding threads being started, which have a non-zero performance |
189 | 189 | overhead. |
190 | 190 |
|
191 | | -### script.runInNewContext(\[sandbox\[, options\]\]) |
| 191 | +### `script.runInNewContext([sandbox[, options]])` |
192 | 192 | <!-- YAML |
193 | 193 | added: v0.3.1 |
194 | 194 | changes: |
@@ -255,7 +255,7 @@ console.log(util.inspect(sandboxes)); |
255 | 255 | // [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] |
256 | 256 | ``` |
257 | 257 |
|
258 | | -### script.runInThisContext(\[options\]) |
| 258 | +### `script.runInThisContext([options])` |
259 | 259 | <!-- YAML |
260 | 260 | added: v0.3.1 |
261 | 261 | changes: |
@@ -301,7 +301,7 @@ console.log(globalVar); |
301 | 301 | // 1000 |
302 | 302 | ``` |
303 | 303 |
|
304 | | -## Class: vm.SourceTextModule |
| 304 | +## Class: `vm.SourceTextModule` |
305 | 305 | <!-- YAML |
306 | 306 | added: v9.6.0 |
307 | 307 | --> |
@@ -404,7 +404,7 @@ const contextifiedSandbox = vm.createContext({ secret: 42 }); |
404 | 404 | })(); |
405 | 405 | ``` |
406 | 406 |
|
407 | | -### Constructor: new vm.SourceTextModule(code\[, options\]) |
| 407 | +### Constructor: `new vm.SourceTextModule(code[, options])` |
408 | 408 |
|
409 | 409 | * `code` {string} JavaScript Module code to parse |
410 | 410 | * `options` |
@@ -468,7 +468,7 @@ const contextifiedSandbox = vm.createContext({ secret: 42 }); |
468 | 468 | })(); |
469 | 469 | ``` |
470 | 470 |
|
471 | | -### module.dependencySpecifiers |
| 471 | +### `module.dependencySpecifiers` |
472 | 472 |
|
473 | 473 | * {string[]} |
474 | 474 |
|
@@ -478,7 +478,7 @@ to disallow any changes to it. |
478 | 478 | Corresponds to the `[[RequestedModules]]` field of |
479 | 479 | [Source Text Module Record][]s in the ECMAScript specification. |
480 | 480 |
|
481 | | -### module.error |
| 481 | +### `module.error` |
482 | 482 |
|
483 | 483 | * {any} |
484 | 484 |
|
@@ -492,7 +492,7 @@ exception due to possible ambiguity with `throw undefined;`. |
492 | 492 | Corresponds to the `[[EvaluationError]]` field of [Source Text Module Record][]s |
493 | 493 | in the ECMAScript specification. |
494 | 494 |
|
495 | | -### module.evaluate(\[options\]) |
| 495 | +### `module.evaluate([options])` |
496 | 496 |
|
497 | 497 | * `options` {Object} |
498 | 498 | * `timeout` {integer} Specifies the number of milliseconds to evaluate |
@@ -522,7 +522,7 @@ This method cannot be called while the module is being evaluated |
522 | 522 | Corresponds to the [Evaluate() concrete method][] field of [Source Text Module |
523 | 523 | Record][]s in the ECMAScript specification. |
524 | 524 |
|
525 | | -### module.link(linker) |
| 525 | +### `module.link(linker)` |
526 | 526 |
|
527 | 527 | * `linker` {Function} |
528 | 528 | * `specifier` {string} The specifier of the requested module: |
@@ -571,7 +571,7 @@ specification. |
571 | 571 | Corresponds to the [Link() concrete method][] field of [Source Text Module |
572 | 572 | Record][]s in the ECMAScript specification. |
573 | 573 |
|
574 | | -### module.namespace |
| 574 | +### `module.namespace` |
575 | 575 |
|
576 | 576 | * {Object} |
577 | 577 |
|
@@ -581,7 +581,7 @@ The namespace object of the module. This is only available after linking |
581 | 581 | Corresponds to the [GetModuleNamespace][] abstract operation in the ECMAScript |
582 | 582 | specification. |
583 | 583 |
|
584 | | -### module.status |
| 584 | +### `module.status` |
585 | 585 |
|
586 | 586 | * {string} |
587 | 587 |
|
@@ -607,13 +607,13 @@ Other than `'errored'`, this status string corresponds to the specification's |
607 | 607 | `'evaluated'` in the specification, but with `[[EvaluationError]]` set to a |
608 | 608 | value that is not `undefined`. |
609 | 609 |
|
610 | | -### module.identifier |
| 610 | +### `module.identifier` |
611 | 611 |
|
612 | 612 | * {string} |
613 | 613 |
|
614 | 614 | The identifier of the current module, as set in the constructor. |
615 | 615 |
|
616 | | -## vm.compileFunction(code\[, params\[, options\]\]) |
| 616 | +## `vm.compileFunction(code[, params[, options]])` |
617 | 617 | <!-- YAML |
618 | 618 | added: v10.10.0 |
619 | 619 | --> |
@@ -644,7 +644,7 @@ Compiles the given code into the provided context/sandbox (if no context is |
644 | 644 | supplied, the current context is used), and returns it wrapped inside a |
645 | 645 | function with the given `params`. |
646 | 646 |
|
647 | | -## vm.createContext(\[sandbox\[, options\]\]) |
| 647 | +## `vm.createContext([sandbox[, options]])` |
648 | 648 | <!-- YAML |
649 | 649 | added: v0.3.1 |
650 | 650 | changes: |
@@ -711,7 +711,7 @@ of that sandbox. |
711 | 711 | The provided `name` and `origin` of the context are made visible through the |
712 | 712 | Inspector API. |
713 | 713 |
|
714 | | -## vm.isContext(sandbox) |
| 714 | +## `vm.isContext(sandbox)` |
715 | 715 | <!-- YAML |
716 | 716 | added: v0.11.7 |
717 | 717 | --> |
@@ -722,7 +722,7 @@ added: v0.11.7 |
722 | 722 | Returns `true` if the given `sandbox` object has been [contextified][] using |
723 | 723 | [`vm.createContext()`][]. |
724 | 724 |
|
725 | | -## vm.runInContext(code, contextifiedSandbox\[, options\]) |
| 725 | +## `vm.runInContext(code, contextifiedSandbox[, options])` |
726 | 726 | <!-- YAML |
727 | 727 | added: v0.3.1 |
728 | 728 | changes: |
@@ -802,7 +802,7 @@ console.log(util.inspect(sandbox)); |
802 | 802 | // { globalVar: 1024 } |
803 | 803 | ``` |
804 | 804 |
|
805 | | -## vm.runInNewContext(code\[, sandbox\[, options\]\]) |
| 805 | +## `vm.runInNewContext(code[, sandbox[, options]])` |
806 | 806 | <!-- YAML |
807 | 807 | added: v0.3.1 |
808 | 808 | changes: |
@@ -900,7 +900,7 @@ console.log(util.inspect(sandbox)); |
900 | 900 | // { animal: 'cat', count: 3, name: 'kitty' } |
901 | 901 | ``` |
902 | 902 |
|
903 | | -## vm.runInThisContext(code\[, options\]) |
| 903 | +## `vm.runInThisContext(code[, options])` |
904 | 904 | <!-- YAML |
905 | 905 | added: v0.3.1 |
906 | 906 | changes: |
@@ -1035,7 +1035,7 @@ within which it can operate. The process of creating the V8 Context and |
1035 | 1035 | associating it with the `sandbox` object is what this document refers to as |
1036 | 1036 | "contextifying" the `sandbox`. |
1037 | 1037 |
|
1038 | | -## Timeout limitations when using process.nextTick(), Promises, and queueMicrotask() |
| 1038 | +## Timeout limitations when using `process.nextTick()`, Promises, and `queueMicrotask()` |
1039 | 1039 |
|
1040 | 1040 | Because of the internal mechanics of how the `process.nextTick()` queue and |
1041 | 1041 | the microtask queue that underlies Promises are implemented within V8 and |
|