typescriptExtractor.resolveBody / javascriptExtractor.resolveBody: the body of a function-valued class field, nested in the arrow / HOF-wrapped arrow.
(node: Node)
| 869 | /// typescriptExtractor.resolveBody / javascriptExtractor.resolveBody: the body |
| 870 | /// of a function-valued class field, nested in the arrow / HOF-wrapped arrow. |
| 871 | fn resolve_field_body(node: Node) -> Option<Node> { |
| 872 | if !matches!(node.kind(), "public_field_definition" | "field_definition") { |
| 873 | return None; |
| 874 | } |
| 875 | for i in 0..node.named_child_count() { |
| 876 | let child = node.named_child(i)?; |
| 877 | if matches!(child.kind(), "arrow_function" | "function_expression") { |
| 878 | return child.child_by_field_name("body"); |
| 879 | } |
| 880 | if child.kind() == "call_expression" { |
| 881 | if let Some(args) = child.child_by_field_name("arguments") { |
| 882 | for j in 0..args.named_child_count() { |
| 883 | if let Some(arg) = args.named_child(j) { |
| 884 | if matches!(arg.kind(), "arrow_function" | "function_expression") { |
| 885 | return arg.child_by_field_name("body"); |
| 886 | } |
| 887 | } |
| 888 | } |
| 889 | } |
| 890 | } |
| 891 | } |
| 892 | None |
| 893 | } |
| 894 | |
| 895 | /// resolveBody ?? getChildByField(node, 'body') — the body-walk resolution. |
| 896 | fn body_of(node: Node) -> Option<Node> { |
no outgoing calls
no test coverage detected