aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontextwrapper.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-24 21:26:33 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-24 21:50:29 +0200
commit0837453ef90f5d5f569702aa1c7620648dae2c00 (patch)
tree43a35f937dfcca3f467d4deafe2800d01f0859da /src/qml/qml/qqmlcontextwrapper.cpp
parent9ff09fb283cd130fb717769b44f54bfbb28efd8a (diff)
parent0ba6dffd96a0dda8e3938b09395075c19e46644b (diff)
Merge remote-tracking branch 'origin/dev' into HEAD
Diffstat (limited to 'src/qml/qml/qqmlcontextwrapper.cpp')
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index 8613c78f6d..2d0ebad764 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -53,6 +53,7 @@
#include <private/qqmllistwrapper_p.h>
#include <private/qqmljavascriptexpression_p.h>
#include <private/qjsvalue_p.h>
+#include <private/qv4qobjectwrapper_p.h>
QT_BEGIN_NAMESPACE
@@ -105,14 +106,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;