(&mut self, node: Node<'t>, depth: u32)
| 1362 | } |
| 1363 | |
| 1364 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1365 | if depth > 12 { |
| 1366 | return; |
| 1367 | } |
| 1368 | // Halts at functionTypes (function_declaration) + the fixed list — |
| 1369 | // lambda_literal halts (no captures inside `by lazy { }` under a |
| 1370 | // hook-consumed property). |
| 1371 | if depth > 0 |
| 1372 | && matches!( |
| 1373 | node.kind(), |
| 1374 | "function_declaration" | "arrow_function" | "function_expression" | "lambda_literal" |
| 1375 | | "lambda_expression" |
| 1376 | ) |
| 1377 | { |
| 1378 | return; |
| 1379 | } |
| 1380 | self.maybe_capture_fn_refs(node); |
| 1381 | for i in 0..node.named_child_count() { |
| 1382 | if let Some(c) = node.named_child(i) { |
| 1383 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1384 | } |
| 1385 | } |
| 1386 | } |
| 1387 | |
| 1388 | fn flush_fn_ref_candidates(&mut self) { |
| 1389 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected