Lines Matching refs:list

9         var list = new Y.ArrayList(["foo"]);
10 Y.Assert.isObject(list);
11 Y.Assert.isInstanceOf(Y.ArrayList, list);
20 var list = new C(['foo']);
22 Y.Assert.areSame(1, list._items.length);
23 list.each(function () {}); // trigger AL constructor from augmentation
25 Y.Assert.areSame(1, list._items.length);
26 Y.Assert.areSame(1, list.size());
34 this.list = new Y.ArrayList(['foo', { bar: 'bar' }, new Y.ArrayList()]);
38 Y.Assert.isString(this.list.item(0));
39 Y.Assert.isObject(this.list.item(1));
40 Y.Assert.isInstanceOf(Y.ArrayList, this.list.item(2));
45 list = this.list;
47 list.each(function (item, index) {
49 if (Y.Lang.isObject(list._items[index])) {
50 Y.Assert.areSame(list._items[index], this);
53 Y.Assert.areSame(list._items[index], item);
61 list = this.list,
64 list.each(function (item, index) {
67 Y.Assert.areSame(list._items[index], item);
75 list = this.list;
77 list.some(function (item, index) {
79 if (Y.Lang.isObject(list._items[index])) {
80 Y.Assert.areSame(list._items[index], this);
84 Y.Assert.areSame(list._items[index], item);
92 list = this.list,
95 list.some(function (item, index) {
97 Y.Assert.areSame(list._items[index], item);
109 list = this.list;
111 list.some(function (item, index) {
113 if (Y.Lang.isObject(list._items[index])) {
114 Y.Assert.areSame(list._items[index], this);
117 Y.Assert.areSame(list._items[index], item);
124 Y.Assert.areSame(0, this.list.indexOf('foo'));
125 Y.Assert.areSame(1, this.list.indexOf(this.list._items[1]));
126 Y.Assert.areSame(2, this.list.indexOf(this.list._items[2]));
128 Y.Assert.areSame(-1, this.list.indexOf('bar'));
129 Y.Assert.areSame(-1, this.list.indexOf({ bar: 'bar' }));
130 Y.Assert.areSame(-1, this.list.indexOf(new Y.ArrayList()));
134 Y.Assert.areSame(3, this.list.size());
140 Y.Assert.isFalse(this.list.isEmpty());
146 var json = this.list.toJSON();
171 var list = new Y.ArrayList([ new Counter(1), new Counter(5) ]);
173 Y.Assert.isUndefined(list.increment);
174 Y.ArrayList.addMethod(list, 'increment');
176 Y.Assert.areSame(1, list.item(0).value);
177 Y.Assert.areSame(5, list.item(1).value);
179 Y.Assert.isFunction(list.increment);
180 list.increment();
182 Y.Assert.areSame(2, list.item(0).value);
183 Y.Assert.areSame(6, list.item(1).value);
185 Y.Assert.isUndefined(list.decrement);
186 Y.Assert.isUndefined(list.reset);
187 Y.ArrayList.addMethod(list, ['decrement', 'reset']);
189 list.decrement();
191 Y.Assert.areSame(1, list.item(0).value);
192 Y.Assert.areSame(5, list.item(1).value);
194 list.decrement(3);
196 Y.Assert.areSame(-2, list.item(0).value);
197 Y.Assert.areSame(2, list.item(1).value);
199 list.reset(3);
201 Y.Assert.areSame(3, list.item(0).value);
202 Y.Assert.areSame(3, list.item(1).value);
214 var list = new Y.ArrayList([ new Counter(1), new Counter(5) ]);
216 Y.Assert.isUndefined(list.getValue);
217 Y.Assert.isUndefined(list.increment);
218 Y.ArrayList.addMethod(list, ['increment', 'getValue']);
220 Y.Assert.isFunction(list.getValue);
221 Y.Assert.isFunction(list.increment);
223 Y.Assert.areSame(list, list.increment());
224 Y.ArrayAssert.itemsAreSame([2, 6], list.getValue());