Skip to content

Commit 802db92

Browse files
RaisinTentargos
authored andcommitted
doc,vm: clarify usage of cachedData in vm.compileFunction()
Fixes: #48175 Signed-off-by: Darshan Sen <[email protected]> PR-URL: #48193 Reviewed-By: Debadree Chatterjee <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 360df25 commit 802db92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/api/vm.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,8 @@ changes:
10051005
is displayed in stack traces produced by this script. **Default:** `0`.
10061006
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
10071007
`TypedArray`, or `DataView` with V8's code cache data for the supplied
1008-
source.
1008+
source. This must be produced by a prior call to [`vm.compileFunction()`][]
1009+
with the same `code` and `params`.
10091010
* `produceCachedData` {boolean} Specifies whether to produce new cache data.
10101011
**Default:** `false`.
10111012
* `parsingContext` {Object} The [contextified][] object in which the said
@@ -1593,6 +1594,7 @@ are not controllable through the timeout either.
15931594
[`script.runInContext()`]: #scriptrunincontextcontextifiedobject-options
15941595
[`script.runInThisContext()`]: #scriptruninthiscontextoptions
15951596
[`url.origin`]: url.md#urlorigin
1597+
[`vm.compileFunction()`]: #vmcompilefunctioncode-params-options
15961598
[`vm.createContext()`]: #vmcreatecontextcontextobject-options
15971599
[`vm.runInContext()`]: #vmrunincontextcode-contextifiedobject-options
15981600
[`vm.runInThisContext()`]: #vmruninthiscontextcode-options

0 commit comments

Comments
 (0)