(&mut self, node: Node<'t>, depth: u32)
| 938 | } |
| 939 | |
| 940 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 941 | if depth > 12 { |
| 942 | return; |
| 943 | } |
| 944 | // Halts at functionTypes (`method`) + the fixed arrow/lambda list; |
| 945 | // NOT at class/module nodes — the module multiply-capture rides this. |
| 946 | if depth > 0 |
| 947 | && matches!( |
| 948 | node.kind(), |
| 949 | "method" | "arrow_function" | "function_expression" | "lambda_literal" |
| 950 | | "lambda_expression" |
| 951 | ) |
| 952 | { |
| 953 | return; |
| 954 | } |
| 955 | self.maybe_capture_fn_refs(node); |
| 956 | for i in 0..node.named_child_count() { |
| 957 | if let Some(c) = node.named_child(i) { |
| 958 | self.scan_fn_ref_subtree(c, depth + 1); |
| 959 | } |
| 960 | } |
| 961 | } |
| 962 | |
| 963 | fn flush_fn_ref_candidates(&mut self) { |
| 964 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected