diff options
author | Christian Stenger <christian.stenger@qt.io> | 2021-10-13 15:41:38 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2021-10-15 05:18:23 +0000 |
commit | e1a15b2db504a6f10d6480d81ed34a3cdd39a3c2 (patch) | |
tree | d8f0d09e608195398d446d6411882fed9697f84f /tests | |
parent | 57fccec1d7c1d5eb5b3cab57945f910dc4c33cc4 (diff) |
QmlJS: Soften strict equality check
Judging on the sense of a strict equality check depends on
different aspects. As attached properties cannot be inspected
easily and e.g. function calls cannot be evaluated as they may
have different return values for different code paths we need
to soften the check to avoid false positives.
Fixes: QTCREATORBUG-25917
Change-Id: I121335a387eb235090346162df4703d3000b7426
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/codemodel/check/equality-checks.qml | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/auto/qml/codemodel/check/equality-checks.qml b/tests/auto/qml/codemodel/check/equality-checks.qml index b562625c23..0a24cccce9 100644 --- a/tests/auto/qml/codemodel/check/equality-checks.qml +++ b/tests/auto/qml/codemodel/check/equality-checks.qml @@ -86,7 +86,7 @@ Rectangle { if (n === s) {} // 325 15 17 if (n === n) {} if (n === N) {} // 325 15 17 - if (n === u) {} // 325 15 17 + if (n === u) {} if (n === b) {} // 325 15 17 if (n === o) {} // 325 15 17 if (n === k) {} @@ -101,7 +101,7 @@ Rectangle { if (N === k) {} if (u === s) {} // 325 15 17 - if (u === n) {} // 325 15 17 + if (u === n) {} if (u === N) {} if (u === u) {} if (u === b) {} // 325 15 17 @@ -132,5 +132,25 @@ Rectangle { if (k === b) {} if (k === o) {} if (k === k) {} + + var nObj = Number("0") + var nNum = Number.fromLocaleString("0") + if (n === 1) {} + if (nObj === 1) {} + if (nNum === 1) {} + + } + + ListView { + model: ListModel{ id: myModel } + delegate: Item { + MouseArea { + anchors.fill: parent + hoverEnabled: true + onClicked: { + if (index === -1) {} + } + } + } } } |