summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testRebranding2.js
blob: 7349c4fc029137fb68a37877aec8a84a7f2036f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
delete q;
delete g;
delete h;
delete a;
delete f;

function testRebranding2() {
    // Same as testRebranding, but the object to be rebranded isn't the global.
    var x = "FAIL";
    function g(){}
    function h(){ x = "ok"; }
    var obj = {m: g};
    var arr = [g, g, g, g, h];
    //assertEq(arr.length > 9, true);
    for (var i = 0; i < 5; i++) {
        obj.m = arr[i];
        obj.m();
    }
    return x;
}
assertEq(testRebranding2(), "ok");