summaryrefslogtreecommitdiff
path: root/js/src/tests/test262/language/expressions/coalesce/cannot-chain-head-with-logical-and.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/expressions/coalesce/cannot-chain-head-with-logical-and.js')
-rw-r--r--js/src/tests/test262/language/expressions/coalesce/cannot-chain-head-with-logical-and.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/coalesce/cannot-chain-head-with-logical-and.js b/js/src/tests/test262/language/expressions/coalesce/cannot-chain-head-with-logical-and.js
new file mode 100644
index 0000000000..7d59d2aee2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/coalesce/cannot-chain-head-with-logical-and.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2019 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: >
+ Cannot immediately contain, or be contained within, an && or || operation.
+esid: sec-conditional-operator
+info: |
+ ConditionalExpression :
+ ShortCircuitExpression
+ ShortCircuitExpression ? AssignmentExpression : AssignmentExpression
+
+ ShortCircuitExpression :
+ LogicalORExpression
+ CoalesceExpression
+
+ CoalesceExpression :
+ CoalesceExpressionHead ?? BitwiseORExpression
+
+ CoalesceExpressionHead :
+ CoalesceExpression
+ BitwiseORExpression
+features: [coalesce-expression]
+negative:
+ phase: early
+ type: SyntaxError
+---*/
+
+0 && 0 ?? true; \ No newline at end of file