| 713 | } |
| 714 | |
| 715 | void DeclarationBuilder::declareMethod(QmlJS::AST::UiObjectInitializer* node, |
| 716 | const RangeInRevision &range, |
| 717 | const Identifier &name, |
| 718 | bool isSlot, |
| 719 | bool isSignal) |
| 720 | { |
| 721 | QString type_name = QmlJS::getQMLAttributeValue(node->members, QStringLiteral("type")).value; |
| 722 | QmlJS::FunctionType::Ptr type(new QmlJS::FunctionType); |
| 723 | |
| 724 | if (type_name.isEmpty()) { |
| 725 | type->setReturnType(typeFromName(QStringLiteral("void"))); |
| 726 | } else { |
| 727 | type->setReturnType(typeFromName(type_name)); |
| 728 | } |
| 729 | |
| 730 | { |
| 731 | DUChainWriteLocker lock; |
| 732 | auto* decl = openDeclaration<ClassFunctionDeclaration>(name, range); |
| 733 | |
| 734 | decl->setIsSlot(isSlot); |
| 735 | decl->setIsSignal(isSignal); |
| 736 | type->setDeclaration(decl); |
| 737 | } |
| 738 | openType(type); |
| 739 | } |
| 740 | |
| 741 | void DeclarationBuilder::declareProperty(QmlJS::AST::UiObjectInitializer* node, |
| 742 | const RangeInRevision &range, |
nothing calls this directly
no test coverage detected