mirror of
https://github.com/safishamsi/graphify.git
synced 2026-08-27 00:36:39 +00:00
#2705 fixed `function` nested in a `function`, but the React idiom that motivated the issue -- a function declared inside an arrow-defined component (`const Panel = () => { function handleClick(){} }`) or an arrow callback (`useEffect(() => { function h(){} })`) -- was still missed: the main walk never recurses into arrow bodies and the scan bailed at the arrow boundary. Refactors the inline scan into a module-level _scan_js_nested_function_ declarations that also descends through arrow / function-expression bodies (attributing nested declarations to the nearest enclosing named scope), and invokes it from the const-arrow branch of _js_extra_walk. Nested bodies join function_bodies, so the central _tracked_body_ids guard prevents double-walk. Adds tests for both arrow idioms. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>