Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Praveen N authored and marijnh committed Aug 20, 2019
1 parent 8118d99 commit aedbc56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acorn-walk/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function simple(node, visitors, baseVisitor, state, override) {
// An ancestor walk keeps an array of ancestor nodes (including the
// current node) and passes them to the callback as third parameter
// (and also as state parameter when no other state is present).
export function ancestor(node, visitors, baseVisitor, state) {
export function ancestor(node, visitors, baseVisitor, state, override) {
let ancestors = []
if (!baseVisitor) baseVisitor = base
;(function c(node, st, override) {
Expand All @@ -38,7 +38,7 @@ export function ancestor(node, visitors, baseVisitor, state) {
baseVisitor[type](node, st, c)
if (found) found(node, st || ancestors, ancestors)
if (isNew) ancestors.pop()
})(node, state)
})(node, state, override)
}

// A recursive walk is one where your functions override the default
Expand Down

0 comments on commit aedbc56

Please sign in to comment.