diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-05-27 20:23:13 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-05-28 21:45:04 +0200 |
commit | 00a07bcbd7a592072822b0e55ab2e75e90c3f9f5 (patch) | |
tree | 1aca723a9e626738d4033c9c05bba85849b0eb9b /src/qml/qml/v8/qv8contextwrapper.cpp | |
parent | 087edaae102a0ff84583c9346acb359e9ea8478d (diff) |
Fix toString and destroy on QObject JS bindings
The auto-tests requires these member functions to not rely on the
thisObject at all.
Also fixed lookup of QObject properties through the context wrapper
to go through get() as the new interface (to catch destroy/toString).
Change-Id: Iacbe8b5ce1895195a84a1224faba3f3bd34cd03b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qv8contextwrapper.cpp')
-rw-r--r-- | src/qml/qml/v8/qv8contextwrapper.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/qml/qml/v8/qv8contextwrapper.cpp b/src/qml/qml/v8/qv8contextwrapper.cpp index 03cedf0303..fec736b777 100644 --- a/src/qml/qml/v8/qv8contextwrapper.cpp +++ b/src/qml/qml/v8/qv8contextwrapper.cpp @@ -323,9 +323,13 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Handle<v8::String> property, // Search scope object if (scopeObject) { - v8::Handle<v8::Value> result = qobjectWrapper->getProperty(scopeObject, propertystring, - context, QV8QObjectWrapper::CheckRevision); - if (!result.IsEmpty()) return result; + QV4::Value wrapper = qobjectWrapper->newQObject(scopeObject)->v4Value(); + if (QV4::Object *o = wrapper.asObject()) { + bool hasProperty = false; + QV4::Value result = o->get(o->engine()->current, propertystring.string().asString(), &hasProperty); + if (hasProperty) + return result; + } } scopeObject = 0; |