_collect_js_symbol_resolution_facts walked every parsed tree in full four
times, and each pass kept only a few node types.
The first pass now walks once and keeps the nodes of the six types the
whole-tree passes filter on, in walk order. Later passes iterate that
list. Each fact list is filled by a single pass, so fact order does not
change.
_walk_js_tree now uses a TreeCursor instead of reading .children at every
node. A cursor is bounded by its start node, so the walks that start
inside a tree (function bodies, and the import and export nodes passed to
_js_named_specifiers) stay inside that subtree.
Overlaps #3353, which also indexes JS nodes once and frees each tree
after use.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>