Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // This test was made to be effective with --no-jm.
3 var list = [
4 { entry00: 0, length: 1 },
5 { entry01: 0, length: 1 },
6 { entry02: 0, length: 1 },
7 { entry03: 0, length: 1 },
8 { entry04: 0, length: 1 },
9 { entry05: 0, length: 1 },
10 { entry06: 0, length: 1 },
11 { entry07: 0, length: 1 },
12 { entry08: 0, length: 1 },
13 { entry09: 0, length: 1 },
14 { entry10: 0, length: 1 },
15 { entry11: 0, length: 1 },
16 { entry12: 0, length: 1 },
17 { entry13: 0, length: 1 },
18 { entry14: 0, length: 1 },
19 { entry15: 0, length: 1 },
20 { entry16: 0, length: 1 }, // cause an overflow.
21 { entry17: 0, length: 1 },
22 [0],
23 (new Uint8Array(new ArrayBuffer(1)))
24 ];
26 function f(obj) {
27 return obj.length;
28 }
30 // Cook the f function on the top of the list to make sure we do not register
31 // our test cases.
32 for (var i = 0; i < 100; i++)
33 f(list[i % 10]);
35 // Register & check stubs.
36 for (var i = 0; i < 40; i++)
37 assertEq(f(list[i % 20]), 1);