aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2019-02-06 10:32:31 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-02-25 12:49:10 +0000
commitcdb8eb988e572411030486ad2834ae54e4567bf3 (patch)
tree6f0e303eaad0b8d8cffc6584c19138e6e55b832b /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
parent3fdc562743cdaddf554785bd83b66b254f560090 (diff)
V4: Rotate loop in ArrayPattern and eliminate "done" label
This prevents jumping over the resetting of the unwind handler when an exception occurs. (cherry-picked from commit 0282b89ec672e25a465a8e51bc74c7fd58a624b1) Fixes: QTBUG-73985 Change-Id: I4a4da815f54c13980d239e0492f9b013991cfbd5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 788ecce1c5..aaaaf09925 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -361,6 +361,7 @@ private slots:
void importLexicalVariables();
void hugeObject();
void templateStringTerminator();
+ void arrayAndException();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8869,6 +8870,14 @@ void tst_qqmlecmascript::templateStringTerminator()
QCOMPARE(value.toString(), QLatin1String("x123\ny^"));
}
+void tst_qqmlecmascript::arrayAndException()
+{
+ QJSEngine engine;
+ const QJSValue value = engine.evaluate("[...[],[,,$]]");
+ // Should not crash
+ QVERIFY(value.isError());
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"