aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/registerPropagation.qml
blob: 53e9be66cee8e3f19170a14985b6d4d839b48c3d (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
34
35
pragma Strict
import QML

QtObject {
    function test() : int {
        var i = 0, x;
        while (i == 0) {
            x = 1;
            i = 1;
        }

        if (i == 1)
            return x;

        return 0
    }

    function produceUndefined1() : string {
        var x;
        return x + "";
    }

    function produceUndefined2() : string {
        var i = 0, x;
        while (i == 1) {
            x = 1;
            i = 1;
        }

        if (i == 0)
            return x + "";

        return 0
    }
}