(&mut self, node: Node<'t>, depth: u32)
| 1348 | } |
| 1349 | |
| 1350 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1351 | stack_guard!(); |
| 1352 | if depth > 12 { |
| 1353 | return; |
| 1354 | } |
| 1355 | // Halts at functionTypes (function_definition) + arrow_function (in |
| 1356 | // the fixed list); anonymous_function is NOT halted — scans descend |
| 1357 | // into closures. |
| 1358 | if depth > 0 |
| 1359 | && matches!( |
| 1360 | node.kind(), |
| 1361 | "function_definition" | "arrow_function" | "function_expression" | "lambda_literal" |
| 1362 | | "lambda_expression" |
| 1363 | ) |
| 1364 | { |
| 1365 | return; |
| 1366 | } |
| 1367 | self.maybe_capture_fn_refs(node); |
| 1368 | for i in 0..node.named_child_count() { |
| 1369 | if let Some(c) = node.named_child(i) { |
| 1370 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1371 | } |
| 1372 | } |
| 1373 | } |
| 1374 | |
| 1375 | fn flush_fn_ref_candidates(&mut self) { |
| 1376 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected