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