aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-12-17 11:22:34 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-12-23 20:49:14 +0100
commit5a7aa7881fa2c7abffb3d34a6b642fe4efcadbf4 (patch)
tree00359fef7f606621a82691c69baccf027b0fcbeb /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
parent5e0ba6b797ca7843609fc19d8c4c96f6f26aacd2 (diff)
QML: Fix proxy iteration
If the target of a proxy was extensible, we did not set the iteratorTarget to its correct value, and thus the ForInIteratorObject would not be usable. Fixes: QTBUG-86323 Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit dd740d6b3469448dc1fd31c1742781e923e9f274)
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 3a9d1bfb4c..9198d3bebf 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -382,6 +382,7 @@ private slots:
void semicolonAfterProperty();
void hugeStack();
void variantConversionMethod();
+ void proxyIteration();
void proxyHandlerTraps();
void gcCrashRegressionTest();
@@ -9306,6 +9307,15 @@ void tst_qqmlecmascript::variantConversionMethod()
QCOMPARE(obj.funcCalled, QLatin1String("QModelIndex"));
}
+void tst_qqmlecmascript::proxyIteration()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("proxyIteration.qml"));
+ QScopedPointer<QObject> root(component.create());
+ QVERIFY2(root != nullptr, qPrintable(component.errorString()));
+ QCOMPARE(root->property("sum").toInt(), 6);
+}
+
void tst_qqmlecmascript::proxyHandlerTraps()
{
const QString expression = QStringLiteral(R"SNIPPET(