summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/tableSwitchFloat.js
blob: 6422af318704e27b677bf0b5ba58b569b04efb2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function f() {
    switch(2) {
        case 1: return 1;
        case 2: return 2;
        default: return -1;
    }
}
assertEq(f(), 2);

function g() {
    switch(3.14) {
        case 3: return 3;
        case 4: return 4;
        default: return -1;
    }
}
assertEq(g(), -1);