summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/emulates-undefined.js
blob: 616a37b19f8ac490cd31e6c86c22be8d3c781f1d (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, objectEmulatingUndefined()];
    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();