From 2b8042182d77241ffe7e6b4edf4e727315f93147 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Thu, 12 Mar 2020 16:28:48 +0100 Subject: Check that QJSValue to set conversion works Also, fix the check to actually test the correct capabilities by using the containerCapabilities function; testing _iteratorCapabilities only worked by chance so far. Task-number: QTBUG-82743 Change-Id: I64f20c6bf1e47737c7b927f79e1e78c1a1603741 Reviewed-by: Ulf Hermann --- src/qml/jsruntime/qv4engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4engine.cpp') diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 1efe09c59f..680ccc02a8 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -1521,7 +1521,7 @@ static QVariant toVariant(QV4::ExecutionEngine *e, const QV4::Value &value, int retn = QVariant(typeHint, temp); QMetaType::destroy(typeHint, temp); auto retnAsIterable = retn.value(); - if (retnAsIterable._iteratorCapabilities & QtMetaTypePrivate::ContainerIsAppendable) { + if (retnAsIterable.containerCapabilities() & QtMetaTypePrivate::ContainerIsAppendable) { auto const length = a->getLength(); QV4::ScopedValue arrayValue(scope); for (qint64 i = 0; i < length; ++i) { -- cgit v1.2.3