diff options
author | Erik Verbruggen <erik.verbruggen@me.com> | 2013-11-11 14:23:50 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-12 14:40:22 +0100 |
commit | ff306b7829a6fcf1e1c28c3b0934ecebccd9e67d (patch) | |
tree | 807e230c1baa2865fb8e2bacdcff30b3c24c2a14 /tests | |
parent | 24b9d7d1c215bf141bcff75e542ef0b00cd5dd3b (diff) |
V4: fix loop block marking for initializer blocks.
Any new blocks generated as part of the initializer were incorrectly
marked as belonging to a loop. For example, if a LocalForStatement
would contain a ternary expression, the generated then and else blocks
would be marked. This would confuse the block scheduling, because all
blocks are postponed unil the condition block (“group start”) is
scheduled.
Task-number: QTBUG-33754
Change-Id: I45919ebeac356f015bb91fe0210472b3df0b56d8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/qtbug_33754.qml | 12 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug_33754.qml b/tests/auto/qml/qqmlecmascript/data/qtbug_33754.qml new file mode 100644 index 0000000000..705334fbfa --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/qtbug_33754.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + property int a: 0 + property int b: 0 + + Component.onCompleted: { + for (var i = ((a > b) ? b : a); i < ((a > b) ? a : b); i++) + { + } + } +} diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index f4641145ab..478611546e 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -308,6 +308,7 @@ private slots: void stringParsing(); void qtbug_32801(); void thisObject(); + void qtbug_33754(); private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); @@ -7321,6 +7322,14 @@ void tst_qqmlecmascript::thisObject() delete object; } +void tst_qqmlecmascript::qtbug_33754() +{ + QQmlComponent component(&engine, testFileUrl("qtbug_33754.qml")); + + QScopedPointer<QObject> obj(component.create()); + QVERIFY(obj != 0); +} + QTEST_MAIN(tst_qqmlecmascript) #include "tst_qqmlecmascript.moc" |