Rich-Harris / estree-walker

Traverse an ESTree-compliant AST
MIT License
389 stars 37 forks source link

Caching child keys not always valid #1

Closed tqc closed 4 years ago

tqc commented 8 years ago

I have some code including ES7 decorators parsed by acorn-es7.

ClassDeclaration.decorators is not always present, so caching the keys means that the decorator node is skipped unless the first class encountered happens to have a decorator.

The filter isn't really necessary given the check for value.type later, so removing the cache shouldn't have much of a performance impact.

Conduitry commented 4 years ago

This can be closed now that caching has been removed in #14.