Debian Codegraph @

js/src/tests/test262/language/expressions/coalesce/cannot-chain-tail-with-logical-and.js

raw
1 // |reftest| error:SyntaxError
2 // Copyright (C) 2019 Leo Balter. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 description: >
7 If the CoalesceExpressionHead is undefined or null, follow return the right-side value.
8 Otherwise, return the left-side value.
9 esid: sec-conditional-operator
10 info: |
11 ConditionalExpression :
12 ShortCircuitExpression
13 ShortCircuitExpression ? AssignmentExpression : AssignmentExpression
14
15 ShortCircuitExpression :
16 LogicalORExpression
17 CoalesceExpression
18
19 CoalesceExpression :
20 CoalesceExpressionHead ?? BitwiseORExpression
21
22 CoalesceExpressionHead :
23 CoalesceExpression
24 BitwiseORExpression
25 features: [coalesce-expression]
26 negative:
27 phase: parse
28 type: SyntaxError
29 ---*/
30
31 $DONOTEVALUATE();
32
33 0 ?? 0 && true;