Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | function testArrayInWithIndexedProto() |
michael@0 | 2 | { |
michael@0 | 3 | Array.prototype[0] = "Got me"; |
michael@0 | 4 | var zeroPresent, zeroPresent2; |
michael@0 | 5 | // Need to go to 18 because in the failure mode this is |
michael@0 | 6 | // testing we have various side-exits in there due to interp and |
michael@0 | 7 | // tracer not agreeing that confuse the issue and cause us to not |
michael@0 | 8 | // hit the bad case within 9 iterations. |
michael@0 | 9 | for (var j = 0; j < 18; ++j) { |
michael@0 | 10 | zeroPresent = 0 in []; |
michael@0 | 11 | } |
michael@0 | 12 | |
michael@0 | 13 | var arr = [1, 2]; |
michael@0 | 14 | delete arr[0]; |
michael@0 | 15 | for (var j = 0; j < 18; ++j) { |
michael@0 | 16 | zeroPresent2 = 0 in arr; |
michael@0 | 17 | } |
michael@0 | 18 | return [zeroPresent, zeroPresent2]; |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | var [ret, ret2] = testArrayInWithIndexedProto(); |
michael@0 | 22 | assertEq(ret, true); |
michael@0 | 23 | assertEq(ret2, true); |
michael@0 | 24 |