| 188 | |
| 189 | template<typename Node> |
| 190 | void DeclarationBuilder::declareParameters(Node* node, QmlJS::AST::UiQualifiedId* Node::*typeFunc) |
| 191 | { |
| 192 | for (Node *plist = node; plist; plist = plist->next) { |
| 193 | const Identifier name(plist->name.toString()); |
| 194 | const RangeInRevision range = m_session->locationToRange(plist->identifierToken); |
| 195 | |
| 196 | AbstractType::Ptr type = (typeFunc ? |
| 197 | typeFromName((plist->*typeFunc)->name.toString()) : // The typeAttribute attribute of plist contains the type name of the argument |
| 198 | AbstractType::Ptr(new IntegralType(IntegralType::TypeMixed)) // No type information, use mixed |
| 199 | ); |
| 200 | |
| 201 | { |
| 202 | DUChainWriteLocker lock; |
| 203 | openDeclaration<Declaration>(name, range); |
| 204 | } |
| 205 | openType(type); |
| 206 | closeAndAssignType(); |
| 207 | |
| 208 | if (QmlJS::FunctionType::Ptr funType = currentType<QmlJS::FunctionType>()) { |
| 209 | funType->addArgument(type); |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | bool DeclarationBuilder::visit(QmlJS::AST::FunctionDeclaration* node) |
| 215 | { |
nothing calls this directly
no test coverage detected