summaryrefslogtreecommitdiff
path: root/src/declarative/qml/qdeclarativescript.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-01-06 12:16:24 +0000
committerQt by Nokia <qt-info@nokia.com>2012-01-06 15:27:10 +0100
commit0888e4397e95c08d67814eb860d24d1791b876bd (patch)
tree818b3c97c9cc19e3318682f2236511d3827dc53e /src/declarative/qml/qdeclarativescript.cpp
parentafbcb4fd4e3f22eac1b68fb9f44b8492c265d9f0 (diff)
downloadqtdeclarative-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.cpp4
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) {