FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node-api-cn/vm/script_createcacheddata.md at master · nodejscn/node-api-cn · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
nodejscn
/
node-api-cn
Public
Notifications
You must be signed in to change notification settings
Fork
1.3k
Star
1.4k
Code
Issues
1
Pull requests
1
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node-api-cn
/
vm
/
script_createcacheddata.md
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (16 loc) · 446 Bytes
Breadcrumbs
node-api-cn
/
vm
/
script_createcacheddata.md
Copy path
File metadata and controls
24 lines (16 loc) · 446 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!-- YAML
added:
v10
.6
.0
-->
*
返回:
{
Buffer
}
创建一个可以被
`Script`
构造函数中
`cachedData`
选项使用的代码缓存。返回
`Buffer`
。可以在任何时候不限次数地调用该方法。
``
`js
const script = new vm.Script(`
function
add
(
a
,
b
)
{
return
a
+
b
;
}
const
x
=
add
(
1
,
2
)
;
`);
const cacheWithoutX = script.createCachedData();
script.runInThisContext();
const cacheWithX = script.createCachedData();
`
``
Back
|
FazBrowse Home
|
New Git URL