Skip to content

Commit

Permalink
don't use childKeys cache on nodes without a type
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed May 21, 2019
1 parent 8ecc0d4 commit 4145e58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/estree-walker.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function visit(node, parent, enter, leave, prop, index) {
if (skipped) return;
}

const keys = childKeys[node.type] || (
const keys = node.type && childKeys[node.type] || (
childKeys[node.type] = Object.keys(node).filter(key => typeof node[key] === 'object')
);

Expand Down

0 comments on commit 4145e58

Please sign in to comment.