Skip to content

Commit

Permalink
fix(espower): decide to be skipped first, then enter node
Browse files Browse the repository at this point in the history
This fixes the case when FunctionExpression begins right after the assertion (its params will be transformed accidentally)
  • Loading branch information
twada committed Sep 14, 2014
1 parent 57cd8a9 commit 9d0a778
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/instrumentor.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ Instrumentor.prototype.instrument = function (ast) {
path = controller.path(),
currentPath = path ? path[path.length - 1] : null;
if (assertionVisitor) {
if (assertionVisitor.isCapturingArgument()) {
if (toBeSkipped(currentNode, parentNode, currentPath)) {
skipping = true;
return controller.skip();
}
} else {
if (toBeSkipped(currentNode, parentNode, currentPath)) {
skipping = true;
return controller.skip();
}
if (!assertionVisitor.isCapturingArgument()) {
return assertionVisitor.enterArgument(currentNode, parentNode, path);
}
} else {
Expand Down

0 comments on commit 9d0a778

Please sign in to comment.