(&mut self, node: Node<'t>, depth: u32, walked: &[usize])
| 1292 | } |
| 1293 | |
| 1294 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &[usize]) { |
| 1295 | stack_guard!(); |
| 1296 | if depth > 12 { |
| 1297 | return; |
| 1298 | } |
| 1299 | // Subtrees the body walker has already been through. |
| 1300 | if walked.contains(&node.id()) { |
| 1301 | return; |
| 1302 | } |
| 1303 | if depth > 0 |
| 1304 | && matches!( |
| 1305 | node.kind(), |
| 1306 | "function_declaration" | "arrow_function" | "function_expression" |
| 1307 | | "lambda_literal" | "lambda_expression" |
| 1308 | ) |
| 1309 | { |
| 1310 | return; |
| 1311 | } |
| 1312 | self.maybe_capture_fn_refs(node); |
| 1313 | for i in 0..node.named_child_count() { |
| 1314 | if let Some(c) = node.named_child(i) { |
| 1315 | self.scan_fn_ref_subtree(c, depth + 1, walked); |
| 1316 | } |
| 1317 | } |
| 1318 | } |
| 1319 | |
| 1320 | fn flush_fn_ref_candidates(&mut self) { |
| 1321 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected