(&mut self, node: Node<'t>, depth: u32)
| 1378 | } |
| 1379 | |
| 1380 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1381 | if depth > 12 { |
| 1382 | return; |
| 1383 | } |
| 1384 | // Halt list: functionTypes (function_signature) + the lambda kinds — |
| 1385 | // function_expression IS dart's lambda, so constant-initializer |
| 1386 | // lambdas don't leak candidates. |
| 1387 | if depth > 0 |
| 1388 | && matches!( |
| 1389 | node.kind(), |
| 1390 | "function_signature" | "arrow_function" | "function_expression" |
| 1391 | | "lambda_literal" | "lambda_expression" |
| 1392 | ) |
| 1393 | { |
| 1394 | return; |
| 1395 | } |
| 1396 | self.maybe_capture_fn_refs(node); |
| 1397 | let mut cursor = node.walk(); |
| 1398 | let children: Vec<Node<'t>> = node.named_children(&mut cursor).collect(); |
| 1399 | for c in children { |
| 1400 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1401 | } |
| 1402 | } |
| 1403 | |
| 1404 | fn flush_fn_ref_candidates(&mut self) { |
| 1405 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected