aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontextwrapper.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@jollamobile.com>2014-02-17 09:35:20 -0600
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-25 20:01:12 +0100
commit7d25db8ff452926e58b7a66608666b35c194fc69 (patch)
tree84a40cdc2f8654e73080ca608e3d3f9b98a50a55 /src/qml/qml/qqmlcontextwrapper.cpp
parent2befbab62808fa75658cb974ce92e8b1ac558e8e (diff)
Fix global object handling in worker script JS files.v5.3.0-alpha1
Task-number: QTBUG-36874 Task-number: QTBUG-36881 Change-Id: Iacf4807dd37862e792ad1ba4ce540a6d48f1e495 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcontextwrapper.cpp')
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index 1ca9c6ac12..d221e072f7 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -288,6 +288,13 @@ void QmlContextWrapper::put(Managed *m, const StringRef name, const ValueRef val
return;
}
+ PropertyAttributes attrs;
+ Property *pd = wrapper->__getOwnProperty__(name, &attrs);
+ if (pd) {
+ wrapper->putValue(pd, attrs, value);
+ return;
+ }
+
if (wrapper->isNullWrapper) {
if (wrapper && wrapper->readOnly) {
QString error = QLatin1String("Invalid write to global property \"") + name->toQString() +
@@ -301,13 +308,6 @@ void QmlContextWrapper::put(Managed *m, const StringRef name, const ValueRef val
return;
}
- PropertyAttributes attrs;
- Property *pd = wrapper->__getOwnProperty__(name, &attrs);
- if (pd) {
- wrapper->putValue(pd, attrs, value);
- return;
- }
-
// Its possible we could delay the calculation of the "actual" context (in the case
// of sub contexts) until it is definately needed.
QQmlContextData *context = wrapper->getContext();