From 48c45418cce7a377eb9117b2f120d5d5aaf3530a Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 18 Nov 2013 15:33:19 +0100 Subject: V4: remove failing assert and fix code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assert failed for cases where the node’s ancestor with lowest semi-dominator number was not the same as the parent. The test case exemplifies this. Task-number: QTBUG-34792 Change-Id: Ie6847b22a27211801bff7479bfcbfaf329c6005a Reviewed-by: Fawzi Mohamed --- tests/auto/qml/qqmlecmascript/data/qtbug34792.qml | 14 ++++++++++++++ tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 12 ++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/auto/qml/qqmlecmascript/data/qtbug34792.qml (limited to 'tests') diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug34792.qml b/tests/auto/qml/qqmlecmascript/data/qtbug34792.qml new file mode 100644 index 0000000000..37c551b587 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/qtbug34792.qml @@ -0,0 +1,14 @@ +import QtQuick 2.1 +Rectangle { + function foo() + { + for (var i = 0; i < 1; i++) + { + if (i >= 0) + break + + return + } + + } +} diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 6e1e606fb8..3aa8fd42e0 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -318,6 +318,7 @@ private slots: void miscTypeTest(); void stackLimits(); void idsAsLValues(); + void qtbug_34792(); private: // static void propertyVarWeakRefCallback(v8::Persistent object, void* parameter); @@ -7477,6 +7478,17 @@ void tst_qqmlecmascript::idsAsLValues() QCOMPARE(component.errorString(), err); } +void tst_qqmlecmascript::qtbug_34792() +{ + QQmlComponent component(&engine, testFileUrl("qtbug34792.qml")); + + QObject *object = component.create(); + if (object == 0) + qDebug() << component.errorString(); + QVERIFY(object != 0); + delete object; +} + QTEST_MAIN(tst_qqmlecmascript) #include "tst_qqmlecmascript.moc" -- cgit v1.2.3