summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/emulates-undefined.js
blob: 3e379d874645d1a192704a0afd748f2f4d93cbbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function test() {
    var values = [undefined, null, Math, createIsHTMLDDA()];
    var expected = [true, true, false, true];

    for (var i=0; i<100; i++) {
        var idx = i % values.length;
        if (values[idx] == undefined)
            assertEq(expected[idx], true);
        else
            assertEq(expected[idx], false);

        if (null != values[idx])
            assertEq(expected[idx], false);
        else
            assertEq(expected[idx], true);
    }
}
test();