summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-07 09:59:10 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-07 16:11:39 +0100
commit7e115c5c5e954ab560afccbd04cb295232a0924c (patch)
tree243346bfc5368652d87950496472472ca246bbbb /tests
parentf03de5497d269fadcddc71794869dddbf8870129 (diff)
[ChangeLog][QtQml] Fix JavaScript Array.pop() not updating the internal array length correctly
While the length property was reporting the correct value, the internal array length was out-of-sync. Task-number: QTBUG-35979 Change-Id: I68820a349cf1ce88c6aabc6a2301a8a861018a10 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 726f8636b6..a1662b495c 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -146,6 +146,8 @@ private slots:
void threadedEngine();
void functionDeclarationsInConditionals();
+
+ void arrayPop_QTBUG_35979();
};
tst_QJSEngine::tst_QJSEngine()
@@ -2692,6 +2694,17 @@ void tst_QJSEngine::functionDeclarationsInConditionals()
QCOMPARE(result.toBool(), true);
}
+void tst_QJSEngine::arrayPop_QTBUG_35979()
+{
+ QJSEngine eng;
+ QJSValue result = eng.evaluate(""
+ "var x = [1, 2]\n"
+ "x.pop()\n"
+ "x[1] = 3\n"
+ "x.toString()\n");
+ QCOMPARE(result.toString(), QString("1,3"));
+}
+
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"