diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-08-26 16:11:38 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-08-30 13:48:19 +0000 |
commit | 12d8004874c3f69ddd5aa7622da309c46930336b (patch) | |
tree | e0bdbb130381ac35469494734c2793ddd153ab8e /src/qml/compiler/qv4isel_p.cpp | |
parent | bb26b8ea7b973cf53099a35028780309750b10c7 (diff) | |
download | qtdeclarative-12d8004874c3f69ddd5aa7622da309c46930336b.tar.gz |
Fix binding dependencies when used in together with functions
When a function called from a binding would access a scope or context
property, we would end up registering those dependencies as permanent
dependencies in the expression and set m_permanentDependenciesRegistered
to true. Then after the binding evaluation itself, we would not end up
registering the real binding's permanent dependencies.
Change-Id: I3b6c1c181aa064d535362c736b5b2bbc4f576ba9
Done-with: Erik
Task-number: QTBUG-54394
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4isel_p.cpp')
-rw-r--r-- | src/qml/compiler/qv4isel_p.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4isel_p.cpp b/src/qml/compiler/qv4isel_p.cpp index 72e6c276a9..efcfb9bd77 100644 --- a/src/qml/compiler/qv4isel_p.cpp +++ b/src/qml/compiler/qv4isel_p.cpp @@ -147,7 +147,7 @@ void IRDecoder::visitMove(IR::Move *s) const int attachedPropertiesId = m->attachedPropertiesId; const bool isSingletonProperty = m->kind == IR::Member::MemberOfSingletonObject; - if (_function && attachedPropertiesId == 0 && !m->property->isConstant()) { + if (_function && attachedPropertiesId == 0 && !m->property->isConstant() && _function->isQmlBinding) { if (m->kind == IR::Member::MemberOfQmlContextObject) { _function->contextObjectPropertyDependencies.insert(m->property->coreIndex(), m->property->notifyIndex()); captureRequired = false; @@ -157,14 +157,14 @@ void IRDecoder::visitMove(IR::Move *s) } } if (m->kind == IR::Member::MemberOfQmlScopeObject || m->kind == IR::Member::MemberOfQmlContextObject) { - getQmlContextProperty(m->base, (IR::Member::MemberKind)m->kind, m->property->coreIndex(), s->target); + getQmlContextProperty(m->base, (IR::Member::MemberKind)m->kind, m->property->coreIndex(), captureRequired, s->target); return; } getQObjectProperty(m->base, m->property->coreIndex(), captureRequired, isSingletonProperty, attachedPropertiesId, s->target); #endif // V4_BOOTSTRAP return; } else if (m->kind == IR::Member::MemberOfIdObjectsArray) { - getQmlContextProperty(m->base, (IR::Member::MemberKind)m->kind, m->idIndex, s->target); + getQmlContextProperty(m->base, (IR::Member::MemberKind)m->kind, m->idIndex, /*captureRequired*/false, s->target); return; } else if (m->base->asTemp() || m->base->asConst() || m->base->asArgLocal()) { getProperty(m->base, *m->name, s->target); |