Skip to content

Commit 6d881b8

Browse files
legendecasjuanarbol
authored andcommittedOct 11, 2022
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 <[email protected]>
1 parent 88dfd50 commit 6d881b8

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
@@ -112,6 +112,18 @@ Creating a new `vm.Script` object compiles `code` but does not run it. The
112112
compiled `vm.Script` can be run later multiple times. The `code` is not bound to
113113
any global object; rather, it is bound before each run, just for that run.
114114

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

117129
<!-- YAML
@@ -1146,16 +1158,7 @@ changes:
11461158
work after that. **Default:** `false`.
11471159
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
11481160
`TypedArray`, or `DataView` with V8's code cache data for the supplied
1149-
source. When supplied, the `cachedDataRejected` value will be set to
1150-
either `true` or `false` depending on acceptance of the data by V8.
1151-
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8
1152-
will attempt to produce code cache data for `code`. Upon success, a
1153-
`Buffer` with V8's code cache data will be produced and stored in the
1154-
`cachedData` property of the returned `vm.Script` instance.
1155-
The `cachedDataProduced` value will be set to either `true` or `false`
1156-
depending on whether code cache data is produced successfully.
1157-
This option is **deprecated** in favor of `script.createCachedData()`.
1158-
**Default:** `false`.
1161+
source.
11591162
* `importModuleDynamically` {Function} Called during evaluation of this module
11601163
when `import()` is called. If this option is not specified, calls to
11611164
`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
@@ -1252,16 +1255,7 @@ changes:
12521255
module will throw a `WebAssembly.CompileError`. **Default:** `true`.
12531256
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
12541257
`TypedArray`, or `DataView` with V8's code cache data for the supplied
1255-
source. When supplied, the `cachedDataRejected` value will be set to
1256-
either `true` or `false` depending on acceptance of the data by V8.
1257-
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8
1258-
will attempt to produce code cache data for `code`. Upon success, a
1259-
`Buffer` with V8's code cache data will be produced and stored in the
1260-
`cachedData` property of the returned `vm.Script` instance.
1261-
The `cachedDataProduced` value will be set to either `true` or `false`
1262-
depending on whether code cache data is produced successfully.
1263-
This option is **deprecated** in favor of `script.createCachedData()`.
1264-
**Default:** `false`.
1258+
source.
12651259
* `importModuleDynamically` {Function} Called during evaluation of this module
12661260
when `import()` is called. If this option is not specified, calls to
12671261
`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
@@ -1339,16 +1333,7 @@ changes:
13391333
work after that. **Default:** `false`.
13401334
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
13411335
`TypedArray`, or `DataView` with V8's code cache data for the supplied
1342-
source. When supplied, the `cachedDataRejected` value will be set to
1343-
either `true` or `false` depending on acceptance of the data by V8.
1344-
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8
1345-
will attempt to produce code cache data for `code`. Upon success, a
1346-
`Buffer` with V8's code cache data will be produced and stored in the
1347-
`cachedData` property of the returned `vm.Script` instance.
1348-
The `cachedDataProduced` value will be set to either `true` or `false`
1349-
depending on whether code cache data is produced successfully.
1350-
This option is **deprecated** in favor of `script.createCachedData()`.
1351-
**Default:** `false`.
1336+
source.
13521337
* `importModuleDynamically` {Function} Called during evaluation of this module
13531338
when `import()` is called. If this option is not specified, calls to
13541339
`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].

0 commit comments

Comments
 (0)
Please sign in to comment.