diff --git a/doc/api/vm.md b/doc/api/vm.md index 9e7ca23e44eb82..9e832ac8bb8606 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -40,7 +40,7 @@ console.log(context.y); // 17 console.log(x); // 1; y is not defined. ``` -## Class: vm.Script +## Class: `vm.Script` @@ -48,7 +48,7 @@ added: v0.3.1 Instances of the `vm.Script` class contain precompiled scripts that can be executed in specific contexts. -### Constructor: new vm.Script(code\[, options\]) +### Constructor: `new vm.Script(code[, options])` @@ -126,7 +126,7 @@ script.runInThisContext(); const cacheWithX = script.createCachedData(); ``` -### script.runInContext(contextifiedObject\[, options\]) +### `script.runInContext(contextifiedObject[, options])` @@ -400,7 +400,7 @@ const contextifiedObject = vm.createContext({ secret: 42 }); })(); ``` -### module.dependencySpecifiers +### `module.dependencySpecifiers` * {string[]} @@ -410,7 +410,7 @@ to disallow any changes to it. Corresponds to the `[[RequestedModules]]` field of [Cyclic Module Record][]s in the ECMAScript specification. -### module.error +### `module.error` * {any} @@ -424,7 +424,7 @@ exception due to possible ambiguity with `throw undefined;`. Corresponds to the `[[EvaluationError]]` field of [Cyclic Module Record][]s in the ECMAScript specification. -### module.evaluate(\[options\]) +### `module.evaluate([options])` * `options` {Object} * `timeout` {integer} Specifies the number of milliseconds to evaluate @@ -454,7 +454,7 @@ This method cannot be called while the module is being evaluated Corresponds to the [Evaluate() concrete method][] field of [Cyclic Module Record][]s in the ECMAScript specification. -### module.link(linker) +### `module.link(linker)` * `linker` {Function} * `specifier` {string} The specifier of the requested module: @@ -502,7 +502,7 @@ specification. Corresponds to the [Link() concrete method][] field of [Cyclic Module Record][]s in the ECMAScript specification. -### module.namespace +### `module.namespace` * {Object} @@ -512,7 +512,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} @@ -538,13 +538,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. -## Class: vm.SourceTextModule +## Class: `vm.SourceTextModule` @@ -559,7 +559,7 @@ flag enabled.* The `vm.SourceTextModule` class provides the [Source Text Module Record][] as defined in the ECMAScript specification. -### Constructor: new vm.SourceTextModule(code\[, options\]) +### Constructor: `new vm.SourceTextModule(code[, options])` * `code` {string} JavaScript Module code to parse * `options` @@ -621,7 +621,7 @@ const contextifiedObject = vm.createContext({ secret: 42 }); })(); ``` -## Class: vm.SyntheticModule +## Class: `vm.SyntheticModule` @@ -650,7 +650,7 @@ const module = new vm.SyntheticModule(['default'], function() { // Use `module` in linking... ``` -### Constructor: new vm.SyntheticModule(exportNames, evaluateCallback\[, options\]) +### Constructor: `new vm.SyntheticModule(exportNames, evaluateCallback[, options])` @@ -670,7 +670,7 @@ Objects assigned to the exports of this instance may allow importers of the module to access information outside the specified `context`. Use `vm.runInContext()` to create objects in a specific context. -### syntheticModule.setExport(name, value) +### `syntheticModule.setExport(name, value)` @@ -697,7 +697,7 @@ const vm = require('vm'); })(); ``` -## vm.compileFunction(code\[, params\[, options\]\]) +## `vm.compileFunction(code[, params[, options]])` @@ -728,7 +728,7 @@ Compiles the given code into the provided context (if no context is supplied, the current context is used), and returns it wrapped inside a function with the given `params`. -## vm.createContext(\[contextObject\[, options\]\]) +## `vm.createContext([contextObject[, options]])` @@ -806,7 +806,7 @@ added: v0.11.7 Returns `true` if the given `oject` object has been [contextified][] using [`vm.createContext()`][]. -## vm.runInContext(code, contextifiedObject\[, options\]) +## `vm.runInContext(code, contextifiedObject[, options])`