From 930cf99345846271a933f227cdc83bd2b9467af2 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 24 Dec 2019 16:06:25 -0800 Subject: [PATCH] doc,vm: use code markup/markdown in headers Backport-PR-URL: https://github.com/nodejs/node/pull/31108 PR-URL: https://github.com/nodejs/node/pull/31086 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater --- doc/api/vm.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/api/vm.md b/doc/api/vm.md index cc244f669401c4..8cbbd3ac0dc041 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -43,7 +43,7 @@ console.log(sandbox.y); // 17 console.log(x); // 1; y is not defined. ``` -## Class: vm.Script +## Class: `vm.Script` @@ -51,7 +51,7 @@ added: v0.3.1 Instances of the `vm.Script` class contain precompiled scripts that can be executed in specific sandboxes (or "contexts"). -### Constructor: new vm.Script(code\[, options\]) +### Constructor: `new vm.Script(code[, options])` @@ -130,7 +130,7 @@ script.runInThisContext(); const cacheWithX = script.createCachedData(); ``` -### script.runInContext(contextifiedSandbox\[, options\]) +### `script.runInContext(contextifiedSandbox[, options])` @@ -404,7 +404,7 @@ const contextifiedSandbox = vm.createContext({ secret: 42 }); })(); ``` -### Constructor: new vm.SourceTextModule(code\[, options\]) +### Constructor: `new vm.SourceTextModule(code[, options])` * `code` {string} JavaScript Module code to parse * `options` @@ -468,7 +468,7 @@ const contextifiedSandbox = vm.createContext({ secret: 42 }); })(); ``` -### module.dependencySpecifiers +### `module.dependencySpecifiers` * {string[]} @@ -478,7 +478,7 @@ to disallow any changes to it. Corresponds to the `[[RequestedModules]]` field of [Source Text Module Record][]s in the ECMAScript specification. -### module.error +### `module.error` * {any} @@ -492,7 +492,7 @@ exception due to possible ambiguity with `throw undefined;`. Corresponds to the `[[EvaluationError]]` field of [Source Text Module Record][]s in the ECMAScript specification. -### module.evaluate(\[options\]) +### `module.evaluate([options])` * `options` {Object} * `timeout` {integer} Specifies the number of milliseconds to evaluate @@ -522,7 +522,7 @@ This method cannot be called while the module is being evaluated Corresponds to the [Evaluate() concrete method][] field of [Source Text Module Record][]s in the ECMAScript specification. -### module.link(linker) +### `module.link(linker)` * `linker` {Function} * `specifier` {string} The specifier of the requested module: @@ -571,7 +571,7 @@ specification. Corresponds to the [Link() concrete method][] field of [Source Text Module Record][]s in the ECMAScript specification. -### module.namespace +### `module.namespace` * {Object} @@ -581,7 +581,7 @@ The namespace object of the module. This is only available after linking Corresponds to the [GetModuleNamespace][] abstract operation in the ECMAScript specification. -### module.status +### `module.status` * {string} @@ -607,13 +607,13 @@ Other than `'errored'`, this status string corresponds to the specification's `'evaluated'` in the specification, but with `[[EvaluationError]]` set to a value that is not `undefined`. -### module.identifier +### `module.identifier` * {string} The identifier of the current module, as set in the constructor. -## vm.compileFunction(code\[, params\[, options\]\]) +## `vm.compileFunction(code[, params[, options]])` @@ -644,7 +644,7 @@ Compiles the given code into the provided context/sandbox (if no context is supplied, the current context is used), and returns it wrapped inside a function with the given `params`. -## vm.createContext(\[sandbox\[, options\]\]) +## `vm.createContext([sandbox[, options]])` @@ -722,7 +722,7 @@ added: v0.11.7 Returns `true` if the given `sandbox` object has been [contextified][] using [`vm.createContext()`][]. -## vm.runInContext(code, contextifiedSandbox\[, options\]) +## `vm.runInContext(code, contextifiedSandbox[, options])`