summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/inlining/array-pop.js
blob: 007b1dc8ec198c96165b3e802c16fc8df00984fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function f(arr) {
    var x;
    for (var i=0; i<100; i++) {
        x = arr.pop();
    }
    return x;
}

var arr = [];
for (var i=0; i<130; i++) {
    arr.push({i: i});
}

assertEq(f(arr).i, 30);
assertEq(arr.length, 30);
assertEq(f(arr), undefined);
assertEq(arr.length, 0);