(&mut self, node: Node<'t>, depth: u32)
| 1010 | } |
| 1011 | |
| 1012 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1013 | if depth > 12 { |
| 1014 | return; |
| 1015 | } |
| 1016 | if depth > 0 |
| 1017 | && matches!( |
| 1018 | node.kind(), |
| 1019 | "function_declaration" | "arrow_function" | "function_expression" |
| 1020 | | "lambda_literal" | "lambda_expression" |
| 1021 | ) |
| 1022 | { |
| 1023 | return; |
| 1024 | } |
| 1025 | self.maybe_capture_fn_refs(node); |
| 1026 | for i in 0..node.named_child_count() { |
| 1027 | if let Some(c) = node.named_child(i) { |
| 1028 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1029 | } |
| 1030 | } |
| 1031 | } |
| 1032 | |
| 1033 | fn flush_fn_ref_candidates(&mut self) { |
| 1034 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected