summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/pic/set2.js
blob: 8713642e485017dee7ec945c6754041887339026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function f(k) {
    var o1 = { a: 5 };
    var o2 = { b : 7, a : 9 };

    for (var i = 0; i < k; ++i) {
	var o = i % 2 ? o2 : o1;
	o.a = i;
    }

    return o1.a + ',' + o2.a;
}

assertEq(f(5), '4,3')
assertEq(f(6), '4,5')