Merge branch 'master' into update-pro-ref
This commit is contained in:
commit
9ad90c5c95
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "2.20.0",
|
"version": "2.20.1",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*",
|
"packages/*",
|
||||||
|
|
|
@ -21,9 +21,9 @@ export function init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const bbCtx = context.getCurrentContext()!
|
const bbCtx = context.getCurrentContext()
|
||||||
|
|
||||||
let { vm } = bbCtx
|
let vm = bbCtx?.vm
|
||||||
if (!vm) {
|
if (!vm) {
|
||||||
// Can't copy the native helpers into the isolate. We just ignore them as they are handled properly from the helpersSource
|
// Can't copy the native helpers into the isolate. We just ignore them as they are handled properly from the helpersSource
|
||||||
const { helpers, ...ctxToPass } = ctx
|
const { helpers, ...ctxToPass } = ctx
|
||||||
|
@ -36,8 +36,11 @@ export function init() {
|
||||||
.withContext(ctxToPass)
|
.withContext(ctxToPass)
|
||||||
.withHelpers()
|
.withHelpers()
|
||||||
|
|
||||||
|
if (bbCtx) {
|
||||||
|
// If we have a context, we want to persist it to reuse the isolate
|
||||||
bbCtx.vm = vm
|
bbCtx.vm = vm
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return vm.execute(js)
|
return vm.execute(js)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error.message === "Script execution timed out.") {
|
if (error.message === "Script execution timed out.") {
|
||||||
|
|
Loading…
Reference in New Issue