summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/ternary-basic.js
blob: 6eb62bda3d89a866fae8bd02f4c5b767c27771ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
load("test-common.js");

try {
    var x = 1;

    assert(x === 1 ? true : false);
    assert((x ? x : 0) === x);
    assert(1 < 2 ? (true) : (false));

    var o = {};
    o.f = true;
    assert(o.f ? true : false);

    assert(1 ? o.f : null);

    console.log("PASS");
} catch (e) {
    console.log("FAIL: " + e);
}