PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/zpao/v8monkey
JavaScript | 24 lines | 17 code | 3 blank | 4 comment | 2 complexity | 3a80644958fa0705004de82ba96f3ebd MD5 | raw file
 1function testArrayInWithIndexedProto()
 2{
 3    Array.prototype[0] = "Got me";
 4    var zeroPresent, zeroPresent2;
 5    // Need to go to 18 because in the failure mode this is
 6    // testing we have various side-exits in there due to interp and
 7    // tracer not agreeing that confuse the issue and cause us to not
 8    // hit the bad case within 9 iterations.
 9    for (var j = 0; j < 18; ++j) {
10	zeroPresent = 0 in [];
11    }
12
13    var arr = [1, 2];
14    delete arr[0];
15    for (var j = 0; j < 18; ++j) {
16	zeroPresent2 = 0 in arr;
17    }
18    return [zeroPresent, zeroPresent2];
19}
20
21var [ret, ret2] = testArrayInWithIndexedProto();
22assertEq(ret, true);
23assertEq(ret2, true);
24