(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>)
| 1474 | } |
| 1475 | |
| 1476 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>) { |
| 1477 | stack_guard!(); |
| 1478 | if depth > 12 { |
| 1479 | return; |
| 1480 | } |
| 1481 | // Subtrees the body walker has already been through. |
| 1482 | if walked.contains(&node.id()) { |
| 1483 | return; |
| 1484 | } |
| 1485 | if depth > 0 |
| 1486 | && matches!( |
| 1487 | node.kind(), |
| 1488 | "function_item" | "function_signature_item" | "arrow_function" |
| 1489 | | "function_expression" | "lambda_literal" | "lambda_expression" |
| 1490 | ) |
| 1491 | { |
| 1492 | return; |
| 1493 | } |
| 1494 | self.maybe_capture_fn_refs(node); |
| 1495 | for c in node.named_children(&mut node.walk()) { |
| 1496 | self.scan_fn_ref_subtree(c, depth + 1, walked); |
| 1497 | } |
| 1498 | } |
| 1499 | |
| 1500 | fn flush_fn_ref_candidates(&mut self) { |
| 1501 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected