Fix test case
authorLars Knoll <lars.knoll@digia.com>
Thu, 13 Jun 2013 15:44:44 +0000 (17:44 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Thu, 13 Jun 2013 16:47:43 +0000 (18:47 +0200)
The for..in statements behavior is actually undefined when
it comes to inserting values into the object being iterated
over. Simply adjust the test case to the v4 behavior.

Change-Id: I85774ae98810d8c14ee457138ccc54082de47802
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
tests/auto/qml/qjsengine/tst_qjsengine.cpp

index c9f6fc4..30a113f 100644 (file)
@@ -1835,7 +1835,7 @@ void tst_QJSEngine::jsForInStatement_mutateWhileIterating()
         QJSValue ret = eng.evaluate("o = { p: 123 }; r = [];"
                                         "for (var p in o) { r[r.length] = p; o.q = 456; } r");
         QStringList lst = qjsvalue_cast<QStringList>(ret);
-        QCOMPARE(lst.size(), 1);
+        QCOMPARE(lst.size(), 2);
         QCOMPARE(lst.at(0), QString::fromLatin1("p"));
     }