summaryrefslogtreecommitdiff
path: root/js/src/tests/test262/language/optional-chaining/static-semantics-simple-assignment.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/optional-chaining/static-semantics-simple-assignment.js')
-rw-r--r--js/src/tests/test262/language/optional-chaining/static-semantics-simple-assignment.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/optional-chaining/static-semantics-simple-assignment.js b/js/src/tests/test262/language/optional-chaining/static-semantics-simple-assignment.js
new file mode 100644
index 0000000000..cbbcedba50
--- /dev/null
+++ b/js/src/tests/test262/language/optional-chaining/static-semantics-simple-assignment.js
@@ -0,0 +1,24 @@
+// |reftest| error:SyntaxError
+
+// Copyright 2019 Google, Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: prod-OptionalExpression
+description: >
+ an optional expression cannot be target of assignment
+info: |
+ Static Semantics: IsValidSimpleAssignmentTarget
+ LeftHandSideExpression:
+ OptionalExpression
+ Return false.
+features: [optional-chaining]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+const obj = {};
+
+obj?.a = 33;