Skip to content

Commit 71cc43e

Browse files
RaisinTendanielleadams
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 4179b93 commit 71cc43e

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
@@ -1002,7 +1002,8 @@ changes:
10021002
is displayed in stack traces produced by this script. **Default:** `0`.
10031003
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or
10041004
`TypedArray`, or `DataView` with V8's code cache data for the supplied
1005-
source.
1005+
source. This must be produced by a prior call to [`vm.compileFunction()`][]
1006+
with the same `code` and `params`.
10061007
* `produceCachedData` {boolean} Specifies whether to produce new cache data.
10071008
**Default:** `false`.
10081009
* `parsingContext` {Object} The [contextified][] object in which the said
@@ -1590,6 +1591,7 @@ are not controllable through the timeout either.
15901591
[`script.runInContext()`]: #scriptrunincontextcontextifiedobject-options
15911592
[`script.runInThisContext()`]: #scriptruninthiscontextoptions
15921593
[`url.origin`]: url.md#urlorigin
1594+
[`vm.compileFunction()`]: #vmcompilefunctioncode-params-options
15931595
[`vm.createContext()`]: #vmcreatecontextcontextobject-options
15941596
[`vm.runInContext()`]: #vmrunincontextcode-contextifiedobject-options
15951597
[`vm.runInThisContext()`]: #vmruninthiscontextcode-options

0 commit comments

Comments
 (0)