diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-03-03 12:39:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-03 20:45:19 +0100 |
commit | ca056ed3fa25b417bc88786377999b04640b1265 (patch) | |
tree | 2014c94b25a9ba9be7c270fb80f09531a30d8eb0 /src/qml/compiler/qqmlcodegenerator.cpp | |
parent | 0f2c736de46f5f85fc75eb04445913fe3721cbde (diff) |
[new compiler] Fix tst_qqmlvaluetypes
* Make sure to remove earlier set bindings for any value type property, not just
scripts. We want font.bold: false to also override an earlier actual binding
for example.
* Propagate on assignments on qualified property names throughout the
chain of bindings - that makes it easier to detect them early on.
* The group property collection in the bindings validator should only include
value bindings to group properties, not on assignments - as they can always
appear in parallel.
Change-Id: Ib7ec4de755a5a8d269324a77cba36eb945366274
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmlcodegenerator.cpp')
-rw-r--r-- | src/qml/compiler/qqmlcodegenerator.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp index 87f2651f42..336c3a11bc 100644 --- a/src/qml/compiler/qqmlcodegenerator.cpp +++ b/src/qml/compiler/qqmlcodegenerator.cpp @@ -939,7 +939,7 @@ void QQmlCodeGenerator::appendBinding(QQmlJS::AST::UiQualifiedId *name, int obje { const QQmlJS::AST::SourceLocation qualifiedNameLocation = name->identifierToken; QmlObject *object = 0; - if (!resolveQualifiedId(&name, &object)) + if (!resolveQualifiedId(&name, &object, isOnAssignment)) return; qSwap(_object, object); appendBinding(qualifiedNameLocation, name->identifierToken, registerString(name->name.toString()), objectIndex, /*isListItem*/false, isOnAssignment); @@ -1058,7 +1058,7 @@ bool QQmlCodeGenerator::setId(const QQmlJS::AST::SourceLocation &idLocation, QQm return true; } -bool QQmlCodeGenerator::resolveQualifiedId(QQmlJS::AST::UiQualifiedId **nameToResolve, QmlObject **object) +bool QQmlCodeGenerator::resolveQualifiedId(QQmlJS::AST::UiQualifiedId **nameToResolve, QmlObject **object, bool onAssignment) { QQmlJS::AST::UiQualifiedId *qualifiedIdElement = *nameToResolve; @@ -1105,6 +1105,9 @@ bool QQmlCodeGenerator::resolveQualifiedId(QQmlJS::AST::UiQualifiedId **nameToRe binding->valueLocation.column = qualifiedIdElement->next->identifierToken.startColumn; binding->flags = 0; + if (onAssignment) + binding->flags |= QV4::CompiledData::Binding::IsOnAssignment; + if (isAttachedProperty) binding->type = QV4::CompiledData::Binding::Type_AttachedProperty; else |