summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug627692-1.js
blob: 9e41eb4efd47002cea01d3f4f56e1bc132134415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var loop1 = '', loop2 = '', actual = '';

var obj = {};
for (var i = 0; i < 10; i++) {
    obj['a' + i] = i;
    loop1 += i;
    loop2 += 'a' + i;
}

Object.defineProperty(obj, 'z', {enumerable: true, get: function () {
            for (var y in obj)
                actual += y;
        }});
(function() {
    for each (var e in obj)
        actual += e;
 })();

assertEq(actual, loop1 + loop2 + "z" + "undefined");