We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83b4822 commit 7bcec16Copy full SHA for 7bcec16
index.js
@@ -1,6 +1,6 @@
1
var vm = require('vm')
2
3
-module.exports = function safeEval (code, context) {
+module.exports = function safeEval (code, context, opts) {
4
var sandbox = {}
5
var resultKey = 'SAFE_EVAL_' + Math.floor(Math.random() * 1000000)
6
sandbox[resultKey] = {}
@@ -10,6 +10,6 @@ module.exports = function safeEval (code, context) {
10
sandbox[key] = context[key]
11
})
12
}
13
- vm.runInNewContext(code, sandbox)
+ vm.runInNewContext(code, sandbox, opts)
14
return sandbox[resultKey]
15
0 commit comments