(&mut self, node: Node<'t>, depth: u32)
| 1491 | } |
| 1492 | |
| 1493 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1494 | stack_guard!(); |
| 1495 | if depth > 12 { |
| 1496 | return; |
| 1497 | } |
| 1498 | // Halts at functionTypes (function_declaration) + the fixed list — |
| 1499 | // lambda_literal IS in it (closures halt the scan). |
| 1500 | if depth > 0 |
| 1501 | && matches!( |
| 1502 | node.kind(), |
| 1503 | "function_declaration" | "arrow_function" | "function_expression" | "lambda_literal" |
| 1504 | | "lambda_expression" |
| 1505 | ) |
| 1506 | { |
| 1507 | return; |
| 1508 | } |
| 1509 | self.maybe_capture_fn_refs(node); |
| 1510 | for i in 0..node.named_child_count() { |
| 1511 | if let Some(c) = node.named_child(i) { |
| 1512 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1513 | } |
| 1514 | } |
| 1515 | } |
| 1516 | |
| 1517 | fn flush_fn_ref_candidates(&mut self) { |
| 1518 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected