summaryrefslogtreecommitdiff
path: root/js/src/tests/test262/language/expressions/coalesce/cannot-chain-head-with-logical-or.js
blob: 8086667f1bbb99742b3cdd95d1c6a72121ae038c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;