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