js/src/jit-test/tests/basic/testRebranding2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/basic/testRebranding2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +delete q;
     1.5 +delete g;
     1.6 +delete h;
     1.7 +delete a;
     1.8 +delete f;
     1.9 +
    1.10 +function testRebranding2() {
    1.11 +    // Same as testRebranding, but the object to be rebranded isn't the global.
    1.12 +    var x = "FAIL";
    1.13 +    function g(){}
    1.14 +    function h(){ x = "ok"; }
    1.15 +    var obj = {m: g};
    1.16 +    var arr = [g, g, g, g, h];
    1.17 +    //assertEq(arr.length > 9, true);
    1.18 +    for (var i = 0; i < 5; i++) {
    1.19 +        obj.m = arr[i];
    1.20 +        obj.m();
    1.21 +    }
    1.22 +    return x;
    1.23 +}
    1.24 +assertEq(testRebranding2(), "ok");

mercurial