compare-ast
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -40,2 +40,5 @@ var parse = require('esprima').parse; | ||
if (Array.isArray(actual)) { | ||
if (actual.length !== expected.length) { | ||
throw new Errors.MatchError(actualAst, expectedAst); | ||
} | ||
actual.forEach(function(_, i) { | ||
@@ -42,0 +45,0 @@ _bind(actual[i], expected[i]); |
{ | ||
"name": "compare-ast", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Determine if two strings of JavaScript have equivalent abstract syntax trees.", | ||
@@ -5,0 +5,0 @@ "main": "lib/compare.js", |
@@ -83,2 +83,7 @@ var compareAst = require('..'); | ||
test('unmatched statements', function() { | ||
noMatch(['', 'var x = 0;'], 3); | ||
noMatch(['var x = 0;', ''], 3); | ||
}); | ||
test('parse failure', function() { | ||
@@ -85,0 +90,0 @@ noMatch(['var a = !;', 'var a = !;'], 1); |
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
13020
325