summaryrefslogtreecommitdiff
path: root/js/src/jit-test/tests/ion/bug1139152.js
blob: 9f3f9503c97eb6eba107030006db80ed3b70a54f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function toLiteralSource(value) {
    if (value === null) {
        return 'null';
    }
    if (typeof value === 'string') {
        return escapeString(value);
    }
    if (typeof value === 'number') {
        return generateNumber(value);
    }
    if (typeof value === 'boolean') {
        return value ? 'true' : 'false';
    }
    value.test();
}

function test(x) {
   var b = x ? true : {};
   return toLiteralSource(b);
}

var output = true
for (var i=0; i<1000; i++) {
    output = test(output) == 'true';
}