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