Skip to content

Commit

Permalink
Merge pull request #8 from Conduitry/patch-2
Browse files Browse the repository at this point in the history
don't use childKeys cache on nodes without a type
  • Loading branch information
Rich-Harris authored May 27, 2019
2 parents 6065e9c + 4145e58 commit 4915838
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 4915838

Please sign in to comment.