(&mut self, node: Node<'t>, depth: u32)
| 1381 | } |
| 1382 | |
| 1383 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1384 | if depth > 12 { |
| 1385 | return; |
| 1386 | } |
| 1387 | // Halts at functionTypes (function_declaration) + the fixed list — |
| 1388 | // lambda_literal IS in it (closures halt the scan). |
| 1389 | if depth > 0 |
| 1390 | && matches!( |
| 1391 | node.kind(), |
| 1392 | "function_declaration" | "arrow_function" | "function_expression" | "lambda_literal" |
| 1393 | | "lambda_expression" |
| 1394 | ) |
| 1395 | { |
| 1396 | return; |
| 1397 | } |
| 1398 | self.maybe_capture_fn_refs(node); |
| 1399 | for i in 0..node.named_child_count() { |
| 1400 | if let Some(c) = node.named_child(i) { |
| 1401 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1402 | } |
| 1403 | } |
| 1404 | } |
| 1405 | |
| 1406 | fn flush_fn_ref_candidates(&mut self) { |
| 1407 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected