Fix defaulting values
This commit is contained in:
parent
601c02a4ac
commit
43a2842833
|
@ -38,10 +38,9 @@ export class IsolatedVM implements VM {
|
||||||
invocationTimeout?: number
|
invocationTimeout?: number
|
||||||
isolateAccumulatedTimeout?: number
|
isolateAccumulatedTimeout?: number
|
||||||
} = {}) {
|
} = {}) {
|
||||||
memoryLimit = memoryLimit || environment.JS_RUNNER_MEMORY_LIMIT
|
this.isolate = new ivm.Isolate({
|
||||||
invocationTimeout = memoryLimit || 1000
|
memoryLimit: memoryLimit || environment.JS_RUNNER_MEMORY_LIMIT,
|
||||||
|
})
|
||||||
this.isolate = new ivm.Isolate({ memoryLimit })
|
|
||||||
this.vm = this.isolate.createContextSync()
|
this.vm = this.isolate.createContextSync()
|
||||||
this.jail = this.vm.global
|
this.jail = this.vm.global
|
||||||
this.jail.setSync("global", this.jail.derefInto())
|
this.jail.setSync("global", this.jail.derefInto())
|
||||||
|
@ -51,7 +50,7 @@ export class IsolatedVM implements VM {
|
||||||
[this.resultKey]: { [this.runResultKey]: "" },
|
[this.resultKey]: { [this.runResultKey]: "" },
|
||||||
})
|
})
|
||||||
|
|
||||||
this.invocationTimeout = invocationTimeout
|
this.invocationTimeout = invocationTimeout || 1000
|
||||||
this.isolateAccumulatedTimeout = isolateAccumulatedTimeout
|
this.isolateAccumulatedTimeout = isolateAccumulatedTimeout
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue