aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-10-05 17:32:05 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-05 10:41:32 +0200
commit17aa5272d8f20f3e64e3bcb5c1c5bb1af8e1c7f2 (patch)
treef374779ed7c0c5240373045049eabc026876afa5 /src
parent435902aa542e09d5701a7e76c967e0b7f5107fb4 (diff)
Set isRoot correctly for value types
Change-Id: I1ddbe5a76fd804df51a3feaf1c0a9004a67abf9f Reviewed-on: http://codereview.qt-project.org/6023 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 69df595bb5..dc992b5b61 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -3118,13 +3118,15 @@ void QDeclarativeCompiler::genBindingAssignment(QDeclarativeScript::Value *bindi
store.value = ref.compiledIndex;
store.context = ref.bindingContext.stack;
store.owner = ref.bindingContext.owner;
- if (valueTypeProperty)
+ if (valueTypeProperty) {
store.property = (valueTypeProperty->index & 0xFFFF) |
((valueTypeProperty->type & 0xFF)) << 16 |
((prop->index & 0xFF) << 24);
- else
+ store.isRoot = (compileState->root == valueTypeProperty->parent);
+ } else {
store.property = prop->index;
- store.isRoot = (compileState->root == obj);
+ store.isRoot = (compileState->root == obj);
+ }
store.line = binding->location.start.line;
output->addInstruction(store);
} else if (ref.dataType == BindingReference::V8) {
@@ -3132,7 +3134,11 @@ void QDeclarativeCompiler::genBindingAssignment(QDeclarativeScript::Value *bindi
store.value = ref.compiledIndex;
store.context = ref.bindingContext.stack;
store.owner = ref.bindingContext.owner;
- store.isRoot = (compileState->root == obj);
+ if (valueTypeProperty) {
+ store.isRoot = (compileState->root == valueTypeProperty->parent);
+ } else {
+ store.isRoot = (compileState->root == obj);
+ }
store.line = binding->location.start.line;
Q_ASSERT(ref.bindingContext.owner == 0 ||
@@ -3149,9 +3155,14 @@ void QDeclarativeCompiler::genBindingAssignment(QDeclarativeScript::Value *bindi
store.assignBinding.value = output->indexForString(ref.rewrittenExpression);
store.assignBinding.context = ref.bindingContext.stack;
store.assignBinding.owner = ref.bindingContext.owner;
- store.assignBinding.isRoot = (compileState->root == obj);
store.assignBinding.line = binding->location.start.line;
+ if (valueTypeProperty) {
+ store.assignBinding.isRoot = (compileState->root == valueTypeProperty->parent);
+ } else {
+ store.assignBinding.isRoot = (compileState->root == obj);
+ }
+
Q_ASSERT(ref.bindingContext.owner == 0 ||
(ref.bindingContext.owner != 0 && valueTypeProperty));
if (ref.bindingContext.owner) {