summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.1.qml
blob: 3c7870839d49c3bdef5c3a8ef29e1002a0fd1c49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import Qt.test 1.0

MyQmlObject {
    value: {
        var value = 0
        switch (stringProperty) {
        case "A":
            value = value + 1
            value = value + 1
            /* should fall through */
        case "S":
            value = value + 1
            value = value + 1
            value = value + 1
            break;
        case "D": { // with curly braces
            value = value + 1
            value = value + 1
            value = value + 1
            break;
        }
        case "F": {
            value = value + 1
            value = value + 1
            value = value + 1
        }
        /* should fall through */
        default:
            value = value + 1
        }
    }
}