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