bson-transpilers
Advanced tools
Comparing version 0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246 to 0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d
/* eslint complexity: 0 */ | ||
const vm = require('vm'); | ||
const bson = require('bson'); | ||
const Context = require('context-eval'); | ||
const { | ||
@@ -607,5 +607,3 @@ BsonTranspilersArgumentError, | ||
}; | ||
const ctx = new Context(sandbox); | ||
const res = ctx.evaluate('__result = ' + input); | ||
ctx.destroy(); | ||
const res = vm.runInContext('__result = ' + input, vm.createContext(sandbox)); | ||
return res; | ||
@@ -612,0 +610,0 @@ } |
/* eslint camelcase: 0 complexity: 0*/ | ||
const Context = require('context-eval'); | ||
const vm = require('vm'); | ||
const { | ||
@@ -509,5 +509,3 @@ BsonTranspilersArgumentError, | ||
}; | ||
const context = new Context(sandbox); | ||
const regexobj = context.evaluate('__result = ' + input); | ||
context.destroy(); | ||
const regexobj = vm.runInContext('__result = ' + input, vm.createContext(sandbox)); | ||
pattern = regexobj.source; | ||
@@ -514,0 +512,0 @@ } catch (error) { |
/* eslint complexity: 0 */ | ||
const vm = require('vm'); | ||
const bson = require('bson'); | ||
const Context = require('context-eval'); | ||
const { | ||
@@ -68,5 +68,3 @@ BsonTranspilersRuntimeError, | ||
}; | ||
const ctx = new Context(sandbox); | ||
const res = ctx.evaluate('__result = ' + input); | ||
ctx.destroy(); | ||
const res = vm.runInContext('__result = ' + input, vm.createContext(sandbox)); | ||
return res; | ||
@@ -73,0 +71,0 @@ } |
{ | ||
"name": "bson-transpilers", | ||
"version": "0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246", | ||
"version": "0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d", | ||
"apiVersion": "0.0.1", | ||
@@ -46,3 +46,2 @@ "productName": "BSON Transpilers", | ||
"bson": "^4.4.1", | ||
"context-eval": "^0.1.0", | ||
"js-yaml": "^3.13.1" | ||
@@ -54,3 +53,3 @@ }, | ||
}, | ||
"gitHead": "4216a27cdf41425fff35938bb42040bb93c2d246" | ||
"gitHead": "59e1f6f134da2a3417bd69a71c7788320608ee5d" | ||
} |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
3
3042757
32764
6
- Removedcontext-eval@^0.1.0
- Removedcontext-eval@0.1.0(transitive)