From a2db40e6c070017960b9f815c66cab354e3466dc Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 13 Sep 2022 14:57:47 +0200 Subject: V4: Make ExecutionEngine::toVariant() static Wherever we need an engine in there, we also have a managed value to get it from. This relieves us from the requirement to drag an engine around wherever we want to call toVariant(). Change-Id: Ib95d02b5fbf5eaa494214e337c9b700e97e5e0df Reviewed-by: Fabian Kosmale --- tests/auto/qml/qqmlecmascript/testtypes.h | 2 +- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/qml/qqmlecmascript') diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h index de8871129d..da882d7840 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.h +++ b/tests/auto/qml/qqmlecmascript/testtypes.h @@ -924,7 +924,7 @@ public: QV4::Scope scope(v->v4engine()); for (int i = 0, end = v->length(); i != end; ++i) { QV4::ScopedValue v4Value(scope, (*v)[i]); - m_actuals.append(v->v4engine()->toVariant(v4Value, QMetaType())); + m_actuals.append(QV4::ExecutionEngine::toVariant(v4Value, QMetaType())); } } Q_INVOKABLE void method_overload2(const QVariantList &list) diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 10dd2ec823..340b1a148d 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -2918,7 +2918,7 @@ void tst_qqmlecmascript::callQtInvokables() { QV4::ScopedValue ret(scope, EVALUATE("object.method_NoArgs_QPointF()")); QVERIFY(!ret->isUndefined()); - QCOMPARE(scope.engine->toVariant(ret, QMetaType {}), QVariant(QPointF(123, 4.5))); + QCOMPARE(QV4::ExecutionEngine::toVariant(ret, QMetaType {}), QVariant(QPointF(123, 4.5))); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 3); QCOMPARE(o->actuals().count(), 0); -- cgit v1.2.3