summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testArgumentsOptimizationFailCornerCase.js
blob: 90f4f11c94728368814031edd8f1f8a40b17f03f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Object.prototype.blah = 42;

function g(a,b,c) {
    assertEq(a, 1);
    assertEq(b, 2);
    assertEq(c, 3);
    return 43;
}

function f() {
    var a = arguments;
    var b = a;
    var s = "blah";
    assertEq(a[s], 42);
    assertEq(b[s], 42);
    assertEq(a[s], 42);
    assertEq(b.length, 3);
    assertEq(a.length, 3);
    assertEq(g.apply(null, b), 43);
}

for (var i = 0; i < 10; ++i)
    f(1,2,3);