Lines Matching refs:array
31 var array = new Array(10);
32 assertEquals(13, array.unshift('1st', '2ns', '3rd'));
33 assertTrue(0 in array);
34 assertTrue(1 in array);
35 assertTrue(2 in array);
36 assertFalse(3 in array);
43 var array = new Array(len);
52 assertFalse(array.hasOwnProperty(0));
53 assertFalse(array.hasOwnProperty(1));
54 assertFalse(array.hasOwnProperty(2));
57 assertEquals(array[0], at0);
58 assertEquals(array[1], undefined);
59 assertEquals(array[2], at2);
61 assertEquals(len, array.unshift());
67 assertFalse(array.hasOwnProperty(0));
68 assertFalse(array.hasOwnProperty(1));
69 assertFalse(array.hasOwnProperty(2));
72 assertEquals(array[0], undefined);
73 assertEquals(array[1], undefined);
74 assertEquals(array[2], undefined);
81 var array = new Array(len);
85 assertEquals(len, array.length);
86 for (var i = 0; i < array.length; i++) {
87 assertEquals(array[i], Array.prototype[i]);
90 assertEquals(len + 1, array.unshift('head'));
92 assertEquals(len + 1, array.length);
94 assertEquals(array[4], Array.prototype[3]);
95 assertTrue(array.hasOwnProperty(4));
97 assertEquals(array[8], Array.prototype[7]);
98 assertTrue(array.hasOwnProperty(8));
102 assertEquals(array[5], Array.prototype[5]);
103 assertFalse(array.hasOwnProperty(5));
105 assertEquals(array[3], Array.prototype[3]);
106 assertFalse(array.hasOwnProperty(3));
108 assertEquals(array[7], Array.prototype[7]);
109 assertFalse(array.hasOwnProperty(7));
119 var array = new Array(len);
127 array.__proto__ = array_proto;
130 assertFalse(array.hasOwnProperty(0));
131 assertFalse(array.hasOwnProperty(1));
132 assertFalse(array.hasOwnProperty(2));
135 assertEquals(array[0], at0);
136 assertEquals(array[1], undefined);
137 assertEquals(array[2], at2);
139 assertEquals(len, array.unshift());
142 assertFalse(array.hasOwnProperty(0));
143 assertFalse(array.hasOwnProperty(1));
144 assertFalse(array.hasOwnProperty(2));
147 assertEquals(array[0], at0);
148 assertEquals(array[1], undefined);
149 assertEquals(array[2], at2);
156 var array = new Array(len);
160 array.__proto__ = array_proto;
162 assertEquals(len, array.length);
163 for (var i = 0; i < array.length; i++) {
164 assertEquals(array[i], array_proto[i]);
167 assertEquals(len + 1, array.unshift('head'));
169 assertEquals(len + 1, array.length);
171 assertEquals(array[4], array_proto[3]);
172 assertTrue(array.hasOwnProperty(4));
174 assertEquals(array[8], array_proto[7]);
175 assertTrue(array.hasOwnProperty(8));
179 assertEquals(array[5], array_proto[5]);
180 assertFalse(array.hasOwnProperty(5));
182 assertEquals(array[3], array_proto[3]);
183 assertFalse(array.hasOwnProperty(3));
185 assertEquals(array[7], array_proto[7]);
186 assertFalse(array.hasOwnProperty(7));
215 var array = [2, 3];
216 Object.defineProperty(array, '1', {enumerable: false});
217 array.unshift(1)
218 assertEquals([1, 2, 3], array);
220 array = [2];
221 array.length = 2;
222 array.__proto__[1] = 3;
223 Object.defineProperty(array.__proto__, '1', {enumerable: false});
224 array.unshift(1);
225 assertEquals([1, 2, 3], array);