aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-11-18 16:36:10 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-11-22 16:17:05 +0100
commitc58d2e5229c39e8007ce5b93822c66af5e765a50 (patch)
tree41dda4299f2f39e366a5af45780ab23c01913412 /tests/auto/qml/qqmllanguage/data
parente3a2b78cc2488ee247d59209dc53ebbfb785588e (diff)
QtQml: Recognize JavaScript null as equivalent to nullptr QObject*
Otherwise we can go into infinite recursion there. Pick-to: 6.2 6.4 Fixes: QTBUG-108651 Change-Id: I73a7c524b28d0eacb151f2090e3dce6afbc029d1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data')
-rw-r--r--tests/auto/qml/qqmllanguage/data/nullIsNull.qml28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/nullIsNull.qml b/tests/auto/qml/qqmllanguage/data/nullIsNull.qml
new file mode 100644
index 0000000000..a6cbbee0bf
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/nullIsNull.qml
@@ -0,0 +1,28 @@
+import QtQml
+
+QtObject {
+ id: root
+ property alias someProperty: internal.someProperty
+
+ property Timer t: Timer {
+ interval: 1
+ running: true
+ onTriggered: root.someProperty = null
+ }
+
+ property QtObject a: QtObject {
+ id: someObjectInstance
+ }
+
+ property QtObject b: QtObject {
+ id: internal
+ property QtObject someProperty: someObjectInstance ? someObjectInstance : null
+ }
+
+ property Connections c: Connections {
+ target: internal
+ function onSomePropertyChanged() {
+ internal.someProperty = null
+ }
+ }
+}