aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data/nullishCoalescing_LHS_Or.qml
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2019-11-29 16:52:16 +0100
committerMaximilian Goldstein <max.goldstein@qt.io>2019-12-05 14:28:47 +0100
commit8fadf5d374936e50b8bce5adb1f10da2f66eac2b (patch)
tree9fa8808718e47673413980aa4448fe8d11dde0c7 /tests/auto/qml/qqmllanguage/data/nullishCoalescing_LHS_Or.qml
parent79166592d17135309a070065e7cb947ffa293828 (diff)
qml/parser: Implement nullish coalescing
Implements the '??' operator as specified in https://github.com/tc39/proposal-nullish-coalescing. Also adds a few tests. Task-number: QTBUG-77926 Change-Id: I3993450c192d11bf1ade0662d945c1553b4c6976 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data/nullishCoalescing_LHS_Or.qml')
-rw-r--r--tests/auto/qml/qqmllanguage/data/nullishCoalescing_LHS_Or.qml8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/nullishCoalescing_LHS_Or.qml b/tests/auto/qml/qqmllanguage/data/nullishCoalescing_LHS_Or.qml
new file mode 100644
index 0000000000..8864524d0d
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/nullishCoalescing_LHS_Or.qml
@@ -0,0 +1,8 @@
+import QtQuick 2.0
+
+Component {
+ Component.onCompleted: {
+ // Should cause an error since having either || or && on any side of the coalescing operator is banned by the specification
+ var bad_lhs_or = 3 || 4 ?? 0;
+ }
+}