summaryrefslogtreecommitdiff
path: root/test/language/expressions/optional-chaining/update-expression-postfix.js
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-04-09 15:03:20 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2021-04-13 07:59:54 +0000
commit7d1cf05c547a636495b2731c4fc2842a01849064 (patch)
tree40bc5864e3df0edd9960b8acfdc769ff894a24ba /test/language/expressions/optional-chaining/update-expression-postfix.js
parent5a105134b9fdf9abc0dc12dc3e44027529634715 (diff)
downloadqtdeclarative-testsuites-7d1cf05c547a636495b2731c4fc2842a01849064.tar.gz
Add optional chaining tests
Change-Id: Ia87313a2756dfbc3d90128ac77cd4dc6c8c137df Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'test/language/expressions/optional-chaining/update-expression-postfix.js')
-rw-r--r--test/language/expressions/optional-chaining/update-expression-postfix.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/language/expressions/optional-chaining/update-expression-postfix.js b/test/language/expressions/optional-chaining/update-expression-postfix.js
new file mode 100644
index 000000000..b7a8e9e21
--- /dev/null
+++ b/test/language/expressions/optional-chaining/update-expression-postfix.js
@@ -0,0 +1,23 @@
+// Copyright 2019 Google, Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: prod-OptionalExpression
+description: >
+ optional chaining is forbidden in write contexts
+info: |
+ UpdateExpression[Yield, Await]:
+ LeftHandSideExpression++
+ LeftHandSideExpression--
+ ++UnaryExpression
+ --UnaryExpression
+features: [optional-chaining]
+negative:
+ type: SyntaxError
+ phase: parse
+---*/
+
+$DONOTEVALUATE();
+
+// LeftHandSideExpression ++
+const a = {};
+a?.b++;