From cdb8eb988e572411030486ad2834ae54e4567bf3 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 6 Feb 2019 10:32:31 +0100 Subject: 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 --- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp') 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 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" -- cgit v1.2.3