(&mut self, node: Node<'t>)
| 525 | // --- extractMethod ------------------------------------------------------------- |
| 526 | |
| 527 | pub(super) fn extract_method(&mut self, node: Node<'t>) { |
| 528 | if !self.inside_class_like() { |
| 529 | // Object-literal methods are ephemeral: walk the body only. |
| 530 | if let Some(parent) = node.parent() { |
| 531 | if matches!(parent.kind(), "object" | "object_expression") { |
| 532 | let body = body_of(node); |
| 533 | self.visit_parameter_defaults(node, body); |
| 534 | if let Some(body) = body { |
| 535 | self.visit_function_body(body); |
| 536 | } |
| 537 | return; |
| 538 | } |
| 539 | } |
| 540 | self.extract_function(node, None); |
| 541 | return; |
| 542 | } |
| 543 | |
| 544 | let name = self.extract_name(node); |
| 545 | let extra = Extra { |
| 546 | docstring: crate::docstring::preceding_docstring(node, self.src), |
| 547 | signature: self.signature_of(node), |
| 548 | visibility: self.visibility_of(node), |
| 549 | is_async: Some(self.is_async(node)), |
| 550 | is_static: self.is_static(node), |
| 551 | ..Extra::default() // methods carry no isExported (mirrors extractMethod) |
| 552 | }; |
| 553 | let Some(row) = self.create_node("method", &name, node, extra) else { |
| 554 | return; |
| 555 | }; |
| 556 | |
| 557 | self.extract_type_annotations(node, row); |
| 558 | self.extract_decorators_for(node, row); |
| 559 | |
| 560 | self.stack.push(Scope { row, kind: "method", name }); |
| 561 | let body = body_of(node); |
| 562 | self.visit_parameter_defaults(node, body); |
| 563 | if let Some(body) = body { |
| 564 | self.visit_function_body(body); |
| 565 | } |
| 566 | self.stack.pop(); |
| 567 | } |
| 568 | |
| 569 | // --- extractInterface / extractEnum / members ----------------------------------- |
| 570 |
no test coverage detected