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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial