static-eval
Advanced tools
Comparing version 0.1.0 to 0.1.1
18
index.js
@@ -74,12 +74,12 @@ module.exports = function (ast, vars) { | ||
else if (node.type === 'CallExpression') { | ||
if ({}.hasOwnProperty.call(vars, node.callee.name)) { | ||
var args = []; | ||
for (var i = 0, l = node.arguments.length; i < l; i++) { | ||
var x = walk(node.arguments[i]); | ||
if (x === FAIL) return FAIL; | ||
args.push(x); | ||
} | ||
return vars[node.callee.name].apply(null, args); | ||
var callee = walk(node.callee); | ||
if (callee === FAIL) return FAIL; | ||
var args = []; | ||
for (var i = 0, l = node.arguments.length; i < l; i++) { | ||
var x = walk(node.arguments[i]); | ||
if (x === FAIL) return FAIL; | ||
args.push(x); | ||
} | ||
else return FAIL; | ||
return callee.apply(null, args); | ||
} | ||
@@ -86,0 +86,0 @@ else if (node.type === 'MemberExpression') { |
{ | ||
"name": "static-eval", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "evaluate statically-analyzable expressions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9378
9
158