(&mut self, node: Node<'t>)
| 145 | // --- extractMethod ------------------------------------------------------------- |
| 146 | |
| 147 | pub(super) fn extract_method(&mut self, node: Node<'t>) { |
| 148 | if !self.inside_class_like() { |
| 149 | // Object-literal methods are ephemeral: walk the body only. |
| 150 | if let Some(parent) = node.parent() { |
| 151 | if matches!(parent.kind(), "object" | "object_expression") { |
| 152 | if let Some(body) = body_of(node) { |
| 153 | self.visit_function_body(body); |
| 154 | } |
| 155 | return; |
| 156 | } |
| 157 | } |
| 158 | self.extract_function(node, None); |
| 159 | return; |
| 160 | } |
| 161 | |
| 162 | let name = self.extract_name(node); |
| 163 | let extra = Extra { |
| 164 | docstring: crate::docstring::preceding_docstring(node, self.src), |
| 165 | signature: self.signature_of(node), |
| 166 | visibility: self.visibility_of(node), |
| 167 | is_async: Some(self.is_async(node)), |
| 168 | is_static: self.is_static(node), |
| 169 | ..Extra::default() // methods carry no isExported (mirrors extractMethod) |
| 170 | }; |
| 171 | let Some(row) = self.create_node("method", &name, node, extra) else { |
| 172 | return; |
| 173 | }; |
| 174 | |
| 175 | self.extract_type_annotations(node, row); |
| 176 | self.extract_decorators_for(node, row); |
| 177 | |
| 178 | self.stack.push(Scope { row, kind: "method", name }); |
| 179 | if let Some(body) = body_of(node) { |
| 180 | self.visit_function_body(body); |
| 181 | } |
| 182 | self.stack.pop(); |
| 183 | } |
| 184 | |
| 185 | // --- extractInterface / extractEnum / members ----------------------------------- |
| 186 |
no test coverage detected