(&mut self, node: Node<'t>, depth: u32)
| 1256 | } |
| 1257 | |
| 1258 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1259 | if depth > 12 { |
| 1260 | return; |
| 1261 | } |
| 1262 | if depth > 0 |
| 1263 | && matches!( |
| 1264 | node.kind(), |
| 1265 | "function_item" | "function_signature_item" | "arrow_function" |
| 1266 | | "function_expression" | "lambda_literal" | "lambda_expression" |
| 1267 | ) |
| 1268 | { |
| 1269 | return; |
| 1270 | } |
| 1271 | self.maybe_capture_fn_refs(node); |
| 1272 | for i in 0..node.named_child_count() { |
| 1273 | if let Some(c) = node.named_child(i) { |
| 1274 | self.scan_fn_ref_subtree(c, depth + 1); |
| 1275 | } |
| 1276 | } |
| 1277 | } |
| 1278 | |
| 1279 | fn flush_fn_ref_candidates(&mut self) { |
| 1280 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected