summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testCondSwitch3.js
blob: 43ea73b7efdb184b0e0687a9f96d39b7faa33137 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var C1 = 1;

function f(x) {
    var s = "";

    switch(x) {
    case 0:
        s += "0";
    case C1:
        s += "1";
    }
    return s;
}

assertEq(f(0), "01");
assertEq(f(1), "1");
assertEq(f(2), "");

assertEq(f(true), "");
assertEq(f(Math), "");