static-eval
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -41,3 +41,4 @@ var unparse = require('escodegen').generate; | ||
} | ||
else if (node.type === 'BinaryExpression') { | ||
else if (node.type === 'BinaryExpression' || | ||
node.type === 'LogicalExpression') { | ||
var l = walk(node.left); | ||
@@ -44,0 +45,0 @@ if (l === FAIL) return FAIL; |
{ | ||
"name": "static-eval", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "evaluate statically-analyzable expressions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,6 +8,6 @@ var test = require('tape'); | ||
var src = '[1,2,3+4*10+n,foo(3+5),obj[""+"x"].y]'; | ||
var src = '[1,2,3+4*10+(n||6),foo(3+5),obj[""+"x"].y]'; | ||
var ast = parse(src).body[0].expression; | ||
var res = evaluate(ast, { | ||
n: 6, | ||
n: false, | ||
foo: function (x) { return x * 100 }, | ||
@@ -14,0 +14,0 @@ obj: { x: { y: 555 } } |
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
9985
171