(&mut self, node: Node<'t>, depth: u32, walked: &[usize])
| 1499 | } |
| 1500 | |
| 1501 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &[usize]) { |
| 1502 | stack_guard!(); |
| 1503 | if depth > 12 { |
| 1504 | return; |
| 1505 | } |
| 1506 | // Subtrees the body walker has already been through. |
| 1507 | if walked.contains(&node.id()) { |
| 1508 | return; |
| 1509 | } |
| 1510 | if depth > 0 |
| 1511 | && matches!( |
| 1512 | node.kind(), |
| 1513 | "function_item" | "function_signature_item" | "arrow_function" |
| 1514 | | "function_expression" | "lambda_literal" | "lambda_expression" |
| 1515 | ) |
| 1516 | { |
| 1517 | return; |
| 1518 | } |
| 1519 | self.maybe_capture_fn_refs(node); |
| 1520 | for i in 0..node.named_child_count() { |
| 1521 | if let Some(c) = node.named_child(i) { |
| 1522 | self.scan_fn_ref_subtree(c, depth + 1, walked); |
| 1523 | } |
| 1524 | } |
| 1525 | } |
| 1526 | |
| 1527 | fn flush_fn_ref_candidates(&mut self) { |
| 1528 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected