diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-17 15:18:12 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-18 07:44:45 +0000 |
commit | 6371b208a9e55845090dcd34234e314c6587c105 (patch) | |
tree | 97aeb75a91b58579d8702d6c13c8d5e5de1e7525 /src/qml | |
parent | 87cf6b7ae7fbaf61595311d04c7e2e99a124e3c6 (diff) |
Revert "Remove this piece of code"
This reverts commit bad007360a0f6fba304d8f4c99826a1250fd886c.
The lookup in the global object is necessary to detect whether we've seen any
unresolved properties. This is used for the optimization of skipping binding
refresh updates when a context property changes.
Task-number: QTBUG-53431
Change-Id: Idb39a32e4b58b915496bbb9d8a098dc17a6f688a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlcontextwrapper.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index 0d84c3bb64..e3770a7ec5 100644 --- a/src/qml/qml/qqmlcontextwrapper.cpp +++ b/src/qml/qml/qqmlcontextwrapper.cpp @@ -99,14 +99,23 @@ ReturnedValue QmlContextWrapper::get(const Managed *m, String *name, bool *hasPr QV4::ExecutionEngine *v4 = resource->engine(); QV4::Scope scope(v4); + // In V8 the JS global object would come _before_ the QML global object, + // so simulate that here. + bool hasProp; + QV4::ScopedValue result(scope, v4->globalObject->get(name, &hasProp)); + if (hasProp) { + if (hasProperty) + *hasProperty = hasProp; + return result->asReturnedValue(); + } + if (resource->d()->isNullWrapper) return Object::get(m, name, hasProperty); if (v4->callingQmlContext() != resource->d()->context) return Object::get(m, name, hasProperty); - bool hasProp; - QV4::ScopedValue result(scope, Object::get(m, name, &hasProp)); + result = Object::get(m, name, &hasProp); if (hasProp) { if (hasProperty) *hasProperty = hasProp; |