estraverse
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -391,2 +391,11 @@ /* | ||
} | ||
function candidateExistsInLeaveList(leavelist, candidate) { | ||
for (var i = leavelist.length - 1; i >= 0; --i) { | ||
if (leavelist[i].node === candidate) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
@@ -473,2 +482,7 @@ Controller.prototype.traverse = function traverse(root, visitor) { | ||
} | ||
if (candidateExistsInLeaveList(leavelist, candidate[current2])) { | ||
continue; | ||
} | ||
if (isProperty(nodeType, candidates[current])) { | ||
@@ -484,2 +498,6 @@ element = new Element(candidate[current2], [key, current2], 'Property', null); | ||
} else if (isNode(candidate)) { | ||
if (candidateExistsInLeaveList(leavelist, candidate)) { | ||
continue; | ||
} | ||
worklist.push(new Element(candidate, key, null, null)); | ||
@@ -486,0 +504,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"main": "estraverse.js", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"engines": { | ||
@@ -9,0 +9,0 @@ "node": ">=4.0" |
36834
750