(&mut self, node: Node<'t>)
| 429 | // --- extractMethod ------------------------------------------------------------- |
| 430 | |
| 431 | pub(super) fn extract_method(&mut self, node: Node<'t>) { |
| 432 | if !self.inside_class_like() { |
| 433 | // Object-literal methods are ephemeral: walk the body only. |
| 434 | if let Some(parent) = node.parent() { |
| 435 | if matches!(parent.kind(), "object" | "object_expression") { |
| 436 | let body = body_of(node); |
| 437 | self.visit_parameter_defaults(node, body); |
| 438 | if let Some(body) = body { |
| 439 | self.visit_function_body(body); |
| 440 | } |
| 441 | return; |
| 442 | } |
| 443 | } |
| 444 | self.extract_function(node, None); |
| 445 | return; |
| 446 | } |
| 447 | |
| 448 | let name = self.extract_name(node); |
| 449 | let extra = Extra { |
| 450 | docstring: crate::docstring::preceding_docstring(node, self.src), |
| 451 | signature: self.signature_of(node), |
| 452 | visibility: self.visibility_of(node), |
| 453 | is_async: Some(self.is_async(node)), |
| 454 | is_static: self.is_static(node), |
| 455 | ..Extra::default() // methods carry no isExported (mirrors extractMethod) |
| 456 | }; |
| 457 | let Some(row) = self.create_node("method", &name, node, extra) else { |
| 458 | return; |
| 459 | }; |
| 460 | |
| 461 | self.extract_type_annotations(node, row); |
| 462 | self.extract_decorators_for(node, row); |
| 463 | |
| 464 | self.stack.push(Scope { row, kind: "method", name }); |
| 465 | let body = body_of(node); |
| 466 | self.visit_parameter_defaults(node, body); |
| 467 | if let Some(body) = body { |
| 468 | self.visit_function_body(body); |
| 469 | } |
| 470 | self.stack.pop(); |
| 471 | } |
| 472 | |
| 473 | // --- extractInterface / extractEnum / members ----------------------------------- |
| 474 |
no test coverage detected