| 1103 | } |
| 1104 | |
| 1105 | fn classify_ts_class_member(node: Node) -> Member { |
| 1106 | if !matches!(node.kind(), "public_field_definition" | "field_definition") { |
| 1107 | return Member::Method; |
| 1108 | } |
| 1109 | for i in 0..node.named_child_count() { |
| 1110 | let Some(child) = node.named_child(i) else { continue }; |
| 1111 | if matches!(child.kind(), "arrow_function" | "function_expression") { |
| 1112 | return Member::Method; |
| 1113 | } |
| 1114 | if child.kind() == "call_expression" { |
| 1115 | if let Some(args) = child.child_by_field_name("arguments") { |
| 1116 | for j in 0..args.named_child_count() { |
| 1117 | if let Some(arg) = args.named_child(j) { |
| 1118 | if matches!(arg.kind(), "arrow_function" | "function_expression") { |
| 1119 | return Member::Method; |
| 1120 | } |
| 1121 | } |
| 1122 | } |
| 1123 | } |
| 1124 | } |
| 1125 | } |
| 1126 | Member::Property |
| 1127 | } |
| 1128 | |
| 1129 | /// typescriptExtractor.resolveBody / javascriptExtractor.resolveBody: the body |
| 1130 | /// of a function-valued class field, nested in the arrow / HOF-wrapped arrow. |