Skip to content

Commit 4e6f786

Browse files
legendecasRafaelGSS
authored andcommitted
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: #44451 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 19f67db commit 4e6f786

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

doc/api/vm.md

+15-30
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,18 @@ Creating a new `vm.Script` object compiles `code` but does not run it. The
114114
compiled `vm.Script` can be run later multiple times. The `code` is not bound to
115115
any global object; rather, it is bound before each run, just for that run.
116116

117+
### `script.cachedDataRejected`
118+
119+
<!-- YAML
120+
added: v5.7.0
121+
-->
122+
123+
* {boolean|undefined}
124+
125+
When `cachedData` is supplied to create the `vm.Script`, this value will be set
126+
to either `true` or `false` depending on acceptance of the data by V8.
127+
Otherwise the value is `undefined`.
128+
117129
### `script.createCachedData()`
118130

119131
<!-- YAML
@@ -1154,16 +1166,7 @@ changes:
11541166
work after that. **Default:** `false`.
11551167
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
11561168
`TypedArray`, or `DataView` with V8's code cache data for the supplied
1157-
source. When supplied, the `cachedDataRejected` value will be set to
1158-
either `true` or `false` depending on acceptance of the data by V8.
1159-
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8
1160-
will attempt to produce code cache data for `code`. Upon success, a
1161-
`Buffer` with V8's code cache data will be produced and stored in the
1162-
`cachedData` property of the returned `vm.Script` instance.
1163-
The `cachedDataProduced` value will be set to either `true` or `false`
1164-
depending on whether code cache data is produced successfully.
1165-
This option is **deprecated** in favor of `script.createCachedData()`.
1166-
**Default:** `false`.
1169+
source.
11671170
* `importModuleDynamically` {Function} Called during evaluation of this module
11681171
when `import()` is called. If this option is not specified, calls to
11691172
`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
@@ -1262,16 +1265,7 @@ changes:
12621265
module will throw a `WebAssembly.CompileError`. **Default:** `true`.
12631266
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
12641267
`TypedArray`, or `DataView` with V8's code cache data for the supplied
1265-
source. When supplied, the `cachedDataRejected` value will be set to
1266-
either `true` or `false` depending on acceptance of the data by V8.
1267-
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8
1268-
will attempt to produce code cache data for `code`. Upon success, a
1269-
`Buffer` with V8's code cache data will be produced and stored in the
1270-
`cachedData` property of the returned `vm.Script` instance.
1271-
The `cachedDataProduced` value will be set to either `true` or `false`
1272-
depending on whether code cache data is produced successfully.
1273-
This option is **deprecated** in favor of `script.createCachedData()`.
1274-
**Default:** `false`.
1268+
source.
12751269
* `importModuleDynamically` {Function} Called during evaluation of this module
12761270
when `import()` is called. If this option is not specified, calls to
12771271
`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
@@ -1351,16 +1345,7 @@ changes:
13511345
work after that. **Default:** `false`.
13521346
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
13531347
`TypedArray`, or `DataView` with V8's code cache data for the supplied
1354-
source. When supplied, the `cachedDataRejected` value will be set to
1355-
either `true` or `false` depending on acceptance of the data by V8.
1356-
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8
1357-
will attempt to produce code cache data for `code`. Upon success, a
1358-
`Buffer` with V8's code cache data will be produced and stored in the
1359-
`cachedData` property of the returned `vm.Script` instance.
1360-
The `cachedDataProduced` value will be set to either `true` or `false`
1361-
depending on whether code cache data is produced successfully.
1362-
This option is **deprecated** in favor of `script.createCachedData()`.
1363-
**Default:** `false`.
1348+
source.
13641349
* `importModuleDynamically` {Function} Called during evaluation of this module
13651350
when `import()` is called. If this option is not specified, calls to
13661351
`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].

0 commit comments

Comments
 (0)