From 5564ba9987273949281b37533b798ebe59553f0e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 27 Sep 2013 22:19:27 +0200 Subject: [PATCH] Fix compilation of the auto test Change-Id: I8c10463aa064a25c0170e6b7f294f48501b42319 Reviewed-by: Lars Knoll --- tests/auto/qml/qqmlecmascript/testtypes.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h index cba0267b26..a93aabd266 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.h +++ b/tests/auto/qml/qqmlecmascript/testtypes.h @@ -1233,13 +1233,17 @@ public: { QQmlData *ddata = QQmlData::get(this); assert(ddata); - QV4::QObjectWrapper *thisObject = QV4::Value::fromReturnedValue(ddata->jsWrapper.value()).as(); - assert(thisObject); + QV4::ExecutionEngine *v4 = ddata->jsWrapper.engine(); + Q_ASSERT(v4); + QV4::Scope scope(v4); + QV4::Scoped thisObject(scope, ddata->jsWrapper.value()); + Q_ASSERT(thisObject); QQmlData *otherDData = QQmlData::get(other); assert(otherDData); - thisObject->defineDefaultProperty(QStringLiteral("autoTestStrongRef"), QV4::Value::fromReturnedValue(otherDData->jsWrapper.value())); + QV4::ScopedValue v(scope, otherDData->jsWrapper.value()); + thisObject->defineDefaultProperty(QStringLiteral("autoTestStrongRef"), v); } void setEngine(QQmlEngine* declarativeEngine)