(&mut self, node: Node<'t>, depth: u32)
| 1508 | } |
| 1509 | |
| 1510 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1511 | stack_guard!(); |
| 1512 | if depth > 12 { |
| 1513 | return; |
| 1514 | } |
| 1515 | // Halts at functionTypes (function_definition) + arrow_function (in |
| 1516 | // the fixed list); anonymous_function is NOT halted — scans descend |
| 1517 | // into closures. |
| 1518 | if depth > 0 |
| 1519 | && matches!( |
| 1520 | node.kind(), |
| 1521 | "function_definition" | "arrow_function" | "function_expression" | "lambda_literal" |
| 1522 | | "lambda_expression" |
| 1523 | ) |
| 1524 | { |
| 1525 | return; |
| 1526 | } |
| 1527 | self.maybe_capture_fn_refs(node); |
| 1528 | for i in 0..node.named_child_count() { |
| 1529 | if let Some(c) = node.named_child(i) { |
| 1530 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1531 | } |
| 1532 | } |
| 1533 | } |
| 1534 | |
| 1535 | fn flush_fn_ref_candidates(&mut self) { |
| 1536 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected