diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2012-01-06 12:16:24 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-06 15:27:10 +0100 |
commit | 0888e4397e95c08d67814eb860d24d1791b876bd (patch) | |
tree | 818b3c97c9cc19e3318682f2236511d3827dc53e /src/declarative/qml/qdeclarativescript.cpp | |
parent | afbcb4fd4e3f22eac1b68fb9f44b8492c265d9f0 (diff) | |
download | qtdeclarative-0888e4397e95c08d67814eb860d24d1791b876bd.tar.gz |
Improve QML error messages
Point at the actual property and method name when raising errors about
them.
Change-Id: Id36df4850b91ae0d225fcda4d101f4b2a073a72e
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativescript.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativescript.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativescript.cpp b/src/declarative/qml/qdeclarativescript.cpp index 1a60893dcd..cbb2bc2cac 100644 --- a/src/declarative/qml/qdeclarativescript.cpp +++ b/src/declarative/qml/qdeclarativescript.cpp @@ -1032,6 +1032,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node) property->isDefaultProperty = node->isDefaultMember; property->isReadOnly = node->isReadonlyMember; property->type = type; + property->nameLocation.line = node->identifierToken.startLine; + property->nameLocation.column = node->identifierToken.startColumn; if (type >= Object::DynamicProperty::Custom) { QDeclarativeScript::TypeReference *typeRef = _parser->findOrCreateType(memberType.toString()); @@ -1218,7 +1220,7 @@ bool ProcessAST::visit(AST::UiSourceElement *node) if (AST::FunctionDeclaration *funDecl = AST::cast<AST::FunctionDeclaration *>(node->sourceElement)) { Object::DynamicSlot *slot = _parser->_pool.New<Object::DynamicSlot>(); - slot->location = location(funDecl->firstSourceLocation(), funDecl->lastSourceLocation()); + slot->location = location(funDecl->identifierToken, funDecl->lastSourceLocation()); AST::FormalParameterList *f = funDecl->formals; while (f) { |