aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-08-09 16:20:22 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-08-10 21:49:32 +0200
commit9e32b23a1514f367921b4a9ee25bc864a008463c (patch)
treed835ba67426e12e51dc1028e8ebac9087a3d43b0 /tests/auto/qml/qjsengine
parentcb37a1d0c3fce7951f5d7f1fb4a04f90e038f01b (diff)
parent36990a732eab2dc16bee89715662f6d3d8b3a0cd (diff)
Merge "Merge remote-tracking branch 'origin/dev' into wip/qt6"
Diffstat (limited to 'tests/auto/qml/qjsengine')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index e08a1cc37e..0ccb8210bc 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -249,6 +249,8 @@ private slots:
void interrupt_data();
void interrupt();
+ void triggerBackwardJumpWithDestructuring();
+
public:
Q_INVOKABLE QJSValue throwingCppMethod1();
Q_INVOKABLE void throwingCppMethod2();
@@ -4938,6 +4940,19 @@ void tst_QJSEngine::interrupt()
#endif
}
+void tst_QJSEngine::triggerBackwardJumpWithDestructuring()
+{
+ QJSEngine engine;
+ auto value = engine.evaluate(
+ "function makeArray(n) { return [...Array(n).keys()]; }\n"
+ "for (let i=0;i<100;++i) {\n"
+ " let arr = makeArray(20)\n"
+ " arr.sort( (a, b) => b - a )\n"
+ "}"
+ );
+ QVERIFY(!value.isError());
+}
+
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"