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

static-eval

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

static-eval - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

5

index.js

@@ -79,2 +79,5 @@ var unparse = require('escodegen').generate;

var ctx = node.callee.object ? walk(node.callee.object) : FAIL;
if (ctx === FAIL) ctx = null;
var args = [];

@@ -86,3 +89,3 @@ for (var i = 0, l = node.arguments.length; i < l; i++) {

}
return callee.apply(null, args);
return callee.apply(ctx, args);
}

@@ -89,0 +92,0 @@ else if (node.type === 'MemberExpression') {

2

package.json
{
"name": "static-eval",
"version": "0.2.1",
"version": "0.2.2",
"description": "evaluate statically-analyzable expressions",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -38,1 +38,9 @@ var test = require('tape');

});
test('array methods', function(t) {
t.plan(1);
var src = '[1, 2, 3].map(function(n) { return n * 2 })';
var ast = parse(src).body[0].expression;
t.deepEqual(evaluate(ast), [2, 4, 6]);
})
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