(&mut self, node: Node<'t>, depth: u32)
| 1316 | } |
| 1317 | |
| 1318 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1319 | stack_guard!(); |
| 1320 | if depth > 12 { |
| 1321 | return; |
| 1322 | } |
| 1323 | // Halt list: functionTypes is EMPTY for scala, so only the literal |
| 1324 | // lambda kinds halt — the scan descends into nested |
| 1325 | // function_definitions inside hook-consumed vals. |
| 1326 | if depth > 0 |
| 1327 | && matches!( |
| 1328 | node.kind(), |
| 1329 | "arrow_function" | "function_expression" | "lambda_literal" | "lambda_expression" |
| 1330 | ) |
| 1331 | { |
| 1332 | return; |
| 1333 | } |
| 1334 | self.maybe_capture_fn_refs(node); |
| 1335 | let mut cursor = node.walk(); |
| 1336 | let children: Vec<Node<'t>> = node.named_children(&mut cursor).collect(); |
| 1337 | for c in children { |
| 1338 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1339 | } |
| 1340 | } |
| 1341 | |
| 1342 | fn flush_fn_ref_candidates(&mut self) { |
| 1343 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected