Skip to content

Commit

Permalink
Add onEnd handler into traverse. Closes estools#73
Browse files Browse the repository at this point in the history
  • Loading branch information
a-x- authored Jul 4, 2016
1 parent 6f6a4e9 commit 95e27f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion estraverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@
current2,
candidates,
candidate,
sentinel;
sentinel,
onEnd;

this.__initialize(root, visitor);

Expand All @@ -482,6 +483,8 @@
worklist.push(new Element(root, null, null, null));
leavelist.push(new Element(null, null, null, null));

onEnd = visitor.onEnd;

while (worklist.length) {
element = worklist.pop();

Expand Down Expand Up @@ -551,6 +554,8 @@
}
}
}

onEnd && onEnd();
};

Controller.prototype.replace = function replace(root, visitor) {
Expand Down

0 comments on commit 95e27f9

Please sign in to comment.