From aedbc56b86c086fcbee3214a6516f59794c2a99c Mon Sep 17 00:00:00 2001 From: Praveen N Date: Tue, 20 Aug 2019 10:59:25 +0530 Subject: [PATCH] Update index.js --- acorn-walk/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acorn-walk/src/index.js b/acorn-walk/src/index.js index 8e29b3583..d95af12be 100644 --- a/acorn-walk/src/index.js +++ b/acorn-walk/src/index.js @@ -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) { @@ -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