Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
4.7.4
-
None
-
Windows7, QtCreator 2.4.1, Qt 4.7.4.
Description
If a switch() statement is used at the end of a block of javascript code, and it has case: clauses with multiple lines, it will only execute the first line of code for the chosen branch. However, if another line of executable code is added AFTER the switch statement, the multiple lines inside the case will now execute.
The following code demonstrates this bug. Simply uncomment the last console statement to see proper execution.
import QtQuick 1.1 Rectangle { width: 100 height: 62 Component.onCompleted: { switch (height) { case 62: console.log("height starts as " + height); height = 55; console.log("height ends as " + height); break; default: console.log("default case"); break; } //console.log("if this line is uncommented, it causes all statements in the switch() to run."); } }