summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlscriptparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 526894e..b622c24 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -342,10 +342,17 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
Value *v = new Value;
v->object = obj;
v->location = obj->location;
- if (state.property)
+ if (state.property) {
state.property->addValue(v);
- else
- state.object->getDefaultProperty()->addValue(v);
+ } else {
+ Property *defaultProp = state.object->getDefaultProperty();
+ if (defaultProp->location.start.line == -1) {
+ defaultProp->location = v->location;
+ defaultProp->location.end = defaultProp->location.start;
+ defaultProp->location.range.length = 0;
+ }
+ defaultProp->addValue(v);
+ }
}
}
@@ -583,8 +590,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
QmlScriptParser::TypeReference *typeRef =
_parser->findOrCreateType(memberType);
typeRef->refObjects.append(_stateStack.top().object);
- property.customType = memberType.toUtf8();
}
+ property.customType = memberType.toUtf8();
property.name = name.toUtf8();
property.location = location(node->firstSourceLocation(),
node->lastSourceLocation());