aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlengine/data/CachedGetterLookup.qml
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-05-16 01:00:46 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-05-16 01:00:46 +0200
commit039071ea5e93d93deb0103e7c9488198dcce55d6 (patch)
treec4cfcf20ed1f836e9c958b2835c84a2b28915e3b /tests/auto/qml/qqmlengine/data/CachedGetterLookup.qml
parent9b36512b9453f429644b0c388d381f7a2fc0f825 (diff)
parent56fbc277a1acc49d9ead4c89edd250a021ef2a01 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'tests/auto/qml/qqmlengine/data/CachedGetterLookup.qml')
-rw-r--r--tests/auto/qml/qqmlengine/data/CachedGetterLookup.qml20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlengine/data/CachedGetterLookup.qml b/tests/auto/qml/qqmlengine/data/CachedGetterLookup.qml
new file mode 100644
index 0000000000..1a2a7ff341
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/CachedGetterLookup.qml
@@ -0,0 +1,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');
+ }
+}
+