aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlengine/data/CachedGetterLookup.qml
blob: 1a2a7ff341ae85ce69fa605866d4f182f85965f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import QtQuick 2.12

QtObject {
    Component.onCompleted: {
        // create getter
        var getFoo = function(o) { return o.foo; }

        // create two diffrent shapes for x,y
        var x = { foo:1 , bar:2 }
        var y = { bar:2 , foo:1 }

        // initialize inline cache with getFoo
        getFoo(x);
        getFoo(y);

        // hit getter lookup with string "crash"
        getFoo('crash');
    }
}