(&mut self, node: Node<'t>, depth: u32)
| 1480 | } |
| 1481 | |
| 1482 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1483 | stack_guard!(); |
| 1484 | if depth > 12 { |
| 1485 | return; |
| 1486 | } |
| 1487 | // Halts at functionTypes (function_definition) + arrow_function (in |
| 1488 | // the fixed list); anonymous_function is NOT halted — scans descend |
| 1489 | // into closures. |
| 1490 | if depth > 0 |
| 1491 | && matches!( |
| 1492 | node.kind(), |
| 1493 | "function_definition" | "arrow_function" | "function_expression" | "lambda_literal" |
| 1494 | | "lambda_expression" |
| 1495 | ) |
| 1496 | { |
| 1497 | return; |
| 1498 | } |
| 1499 | self.maybe_capture_fn_refs(node); |
| 1500 | for c in node.named_children(&mut node.walk()) { |
| 1501 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1502 | } |
| 1503 | } |
| 1504 | |
| 1505 | fn flush_fn_ref_candidates(&mut self) { |
| 1506 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected