GeezerVison is showing github.com — doc,vm: clarify usage of cachedData in vm.compileFunction() · nodejs/node@802db92
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/vm.md +3-1Lines changed: 3 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1005,7 +1005,8 @@ changes: |
1005 | 1005 | is displayed in stack traces produced by this script. **Default:** `0`. |
1006 | 1006 | * `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or |
1007 | 1007 | `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`. |
1009 | 1010 | * `produceCachedData` {boolean} Specifies whether to produce new cache data. |
1010 | 1011 | **Default:** `false`. |
1011 | 1012 | * `parsingContext` {Object} The [contextified][] object in which the said |
@@ -1593,6 +1594,7 @@ are not controllable through the timeout either. |
1593 | 1594 | [`script.runInContext()`]: #scriptrunincontextcontextifiedobject-options |
1594 | 1595 | [`script.runInThisContext()`]: #scriptruninthiscontextoptions |
1595 | 1596 | [`url.origin`]: url.md#urlorigin |
| 1597 | +[`vm.compileFunction()`]: #vmcompilefunctioncode-params-options |
1596 | 1598 | [`vm.createContext()`]: #vmcreatecontextcontextobject-options |
1597 | 1599 | [`vm.runInContext()`]: #vmrunincontextcode-contextifiedobject-options |
1598 | 1600 | [`vm.runInThisContext()`]: #vmruninthiscontextcode-options |
|