scanFnRefSubtree: capture-only walk of subtrees the main walkers skip (variable-declaration initializers). Halts at nested functions/lambdas.
(&mut self, node: Node<'t>, depth: u32)
| 1760 | /// scanFnRefSubtree: capture-only walk of subtrees the main walkers skip |
| 1761 | /// (variable-declaration initializers). Halts at nested functions/lambdas. |
| 1762 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1763 | stack_guard!(); |
| 1764 | if depth > 12 { |
| 1765 | return; |
| 1766 | } |
| 1767 | if depth > 0 |
| 1768 | && matches!( |
| 1769 | node.kind(), |
| 1770 | "function_definition" | "arrow_function" | "function_expression" |
| 1771 | | "lambda_literal" | "lambda_expression" |
| 1772 | ) |
| 1773 | { |
| 1774 | return; |
| 1775 | } |
| 1776 | self.maybe_capture_fn_refs(node); |
| 1777 | for i in 0..node.named_child_count() { |
| 1778 | if let Some(c) = node.named_child(i) { |
| 1779 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1780 | } |
| 1781 | } |
| 1782 | } |
| 1783 | |
| 1784 | /// flushFnRefCandidates with the cFamily gate policy: value/list positions |
| 1785 | /// at FILE scope skip the same-file/import gate (C has no symbol imports); |
no test coverage detected