blob: fb37d458c0bad891814d00631bdd538591f2331f [file] [log] [blame]
utatane.tea@gmail.com9842c042015-07-27 23:51:28 +00001function shouldBe(actual, expected) {
2 if (actual !== expected)
3 throw new Error('bad value: ' + actual);
4}
5
6function testing(object) {
7 shouldBe(object[0], 0);
8 shouldBe(object[1], 1);
9 shouldBe(object[2], "String");
10}
11noInline(testing);
12
13function testing2(object) {
14 shouldBe(object[0], 0);
15 shouldBe(object[1], 1);
16 shouldBe(object[2], "String");
17}
18noInline(testing2);
19
20for (var i = 0; i < 10000; ++i)
21 testing({
22 0: 0,
23 1: 1,
24 2: "String"
25 });
26
27testing({
28 0: 0,
29 get 1() {
30 return 1;
31 },
32 2: "String"
33});
34
35for (var i = 0; i < 10000; ++i)
36 testing2({
37 0: 0,
38 get 1() {
39 return 1;
40 },
41 2: "String"
42 });
43
44/* vim: set sw=4 ts=4 et tw=80 : */