Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eval

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eval - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

19

eval.js

@@ -8,5 +8,3 @@ var vm = require('vm')

if (!a || !b) return a
// Include all non-enumerable variables, including console (v10+),
// process (v12+), URL, etc.
var keys = Object.getOwnPropertyNames(b)
var keys = Object.keys(b)
for (var k, i = 0, n = keys.length; i < n; i++) {

@@ -19,2 +17,5 @@ k = keys[i]

var vmGlobals = new vm.Script('Object.getOwnPropertyNames(globalThis)')
.runInNewContext()
// Return the exports/module.exports variable set in the content

@@ -42,3 +43,15 @@ // content (String|VmScript): required

if (includeGlobals) {
// Merge enumerable variables on `global`
merge(sandbox, global)
// Merge all non-enumerable variables on `global`, including console (v10+),
// process (v12+), URL, etc. We first filter out anything that's already in
// the VM scope (i.e. those in the ES standard) so we don't have two copies
Object.getOwnPropertyNames(global).forEach((name) => {
if (!vmGlobals.includes(name)) {
sandbox[name] = global[name]
}
})
// `console` exists in VM scope, but we want to pipe the output to the
// process'
sandbox.console = console
sandbox.require = requireLike(_filename)

@@ -45,0 +58,0 @@ }

2

package.json

@@ -6,3 +6,3 @@ {

, "keywords": ["require","eval","vm","module"]
, "version": "0.1.7"
, "version": "0.1.8"
, "homepage": "http://github.com/pierrec/node-eval"

@@ -9,0 +9,0 @@ , "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc