diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/basic/testRebranding2.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/basic/testRebranding2.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,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");