summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.3.qml
blob: 5b05d88767c47bc9473e391b817409c201a1074e (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) {
        default:
            value = value + 1
        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 */
        }
    }
}