Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChengzhong Wu <chengzhong.wcz@alibaba-inc.com>2022-09-06 20:26:22 +0300
committerJuan José Arboleda <soyjuanarbol@gmail.com>2022-10-11 22:45:22 +0300
commit6d881b86113f82ac36c27a6714eb3a3550c98d4a (patch)
treefc294650c55418d210d7707a5ceac9121fdabfbf /doc
parent88dfd50079361cdcb627d2b674e48fe3459fcb68 (diff)
doc: document attribute Script.cachedDataRejected
Explicitly document the attribute `Script.cachedDataRejected` in a dedicated section. Removes the documented option `produceCachedData` and the description of `cachedDataRejected` in `vm.runInContext`, `vm.runInNewContext`, and `vm.runInThisContext` as the created `vm.Script` instance is not accessible from userland in these methods. PR-URL: https://github.com/nodejs/node/pull/44451 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/vm.md45
1 files changed, 15 insertions, 30 deletions
diff --git a/doc/api/vm.md b/doc/api/vm.md
index c8a0a27c991..2113fafb631 100644
--- a/doc/api/vm.md
+++ b/doc/api/vm.md
@@ -112,6 +112,18 @@ Creating a new `vm.Script` object compiles `code` but does not run it. The
compiled `vm.Script` can be run later multiple times. The `code` is not bound to
any global object; rather, it is bound before each run, just for that run.
+### `script.cachedDataRejected`
+
+<!-- YAML
+added: v5.7.0
+-->
+
+* {boolean|undefined}
+
+When `cachedData` is supplied to create the `vm.Script`, this value will be set
+to either `true` or `false` depending on acceptance of the data by V8.
+Otherwise the value is `undefined`.
+
### `script.createCachedData()`
<!-- YAML
@@ -1146,16 +1158,7 @@ changes:
work after that. **Default:** `false`.
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
`TypedArray`, or `DataView` with V8's code cache data for the supplied
- source. When supplied, the `cachedDataRejected` value will be set to
- either `true` or `false` depending on acceptance of the data by V8.
- * `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8
- will attempt to produce code cache data for `code`. Upon success, a
- `Buffer` with V8's code cache data will be produced and stored in the
- `cachedData` property of the returned `vm.Script` instance.
- The `cachedDataProduced` value will be set to either `true` or `false`
- depending on whether code cache data is produced successfully.
- This option is **deprecated** in favor of `script.createCachedData()`.
- **Default:** `false`.
+ source.
* `importModuleDynamically` {Function} Called during evaluation of this module
when `import()` is called. If this option is not specified, calls to
`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
@@ -1252,16 +1255,7 @@ changes:
module will throw a `WebAssembly.CompileError`. **Default:** `true`.
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
`TypedArray`, or `DataView` with V8's code cache data for the supplied
- source. When supplied, the `cachedDataRejected` value will be set to
- either `true` or `false` depending on acceptance of the data by V8.
- * `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8
- will attempt to produce code cache data for `code`. Upon success, a
- `Buffer` with V8's code cache data will be produced and stored in the
- `cachedData` property of the returned `vm.Script` instance.
- The `cachedDataProduced` value will be set to either `true` or `false`
- depending on whether code cache data is produced successfully.
- This option is **deprecated** in favor of `script.createCachedData()`.
- **Default:** `false`.
+ source.
* `importModuleDynamically` {Function} Called during evaluation of this module
when `import()` is called. If this option is not specified, calls to
`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
@@ -1339,16 +1333,7 @@ changes:
work after that. **Default:** `false`.
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
`TypedArray`, or `DataView` with V8's code cache data for the supplied
- source. When supplied, the `cachedDataRejected` value will be set to
- either `true` or `false` depending on acceptance of the data by V8.
- * `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8
- will attempt to produce code cache data for `code`. Upon success, a
- `Buffer` with V8's code cache data will be produced and stored in the
- `cachedData` property of the returned `vm.Script` instance.
- The `cachedDataProduced` value will be set to either `true` or `false`
- depending on whether code cache data is produced successfully.
- This option is **deprecated** in favor of `script.createCachedData()`.
- **Default:** `false`.
+ source.
* `importModuleDynamically` {Function} Called during evaluation of this module
when `import()` is called. If this option is not specified, calls to
`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].