Skip to content

Commit 7bcec16

Browse files
committed
Added opts arg to pass to vm.runInNewContext
1 parent 83b4822 commit 7bcec16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var vm = require('vm')
22

3-
module.exports = function safeEval (code, context) {
3+
module.exports = function safeEval (code, context, opts) {
44
var sandbox = {}
55
var resultKey = 'SAFE_EVAL_' + Math.floor(Math.random() * 1000000)
66
sandbox[resultKey] = {}
@@ -10,6 +10,6 @@ module.exports = function safeEval (code, context) {
1010
sandbox[key] = context[key]
1111
})
1212
}
13-
vm.runInNewContext(code, sandbox)
13+
vm.runInNewContext(code, sandbox, opts)
1414
return sandbox[resultKey]
1515
}

0 commit comments

Comments
 (0)