r96513 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96512‎ | r96513 | r96514 >
Date:22:22, 7 September 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Renamed items() to all() to avoid name conflicts
Modified paths:
  • /trunk/parsers/wikidom/lib/synth/bases/es.ModelContainer.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js (modified) (history)
  • /trunk/parsers/wikidom/tests/synth/test.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/tests/synth/test.js
@@ -35,7 +35,7 @@
3636
3737 // Accessing
3838
39 - deepEqual( container1.items(), [item1, item2, item3], 'es.ModelContainer.items returns all items' )
 39+ deepEqual( container1.all(), [item1, item2, item3], 'es.ModelContainer.items returns all items' )
4040
4141 strictEqual( container1.get( 0 ), item1, 'es.ModelContainer.get returns correct item at index' );
4242 strictEqual( container1.get( 1 ), item2, 'es.ModelContainer.get returns correct item at index' );
@@ -121,35 +121,35 @@
122122 // Inserting
123123
124124 container1.append( item1 );
125 - deepEqual( container1.items(), [item1], 'es.ModelContainer.append adds item to end' );
 125+ deepEqual( container1.all(), [item1], 'es.ModelContainer.append adds item to end' );
126126 container1.prepend( item3 );
127 - deepEqual( container1.items(), [item3, item1], 'es.ModelContainer.prepend adds item to begining' );
 127+ deepEqual( container1.all(), [item3, item1], 'es.ModelContainer.prepend adds item to begining' );
128128 container1.insertBefore( item2, item1 );
129129 deepEqual(
130 - container1.items(),
 130+ container1.all(),
131131 [item3, item2, item1],
132132 'es.ModelContainer.insertBefore inserts item before another'
133133 );
134134 container1.insertBefore( item2, item3 );
135135 deepEqual(
136 - container1.items(),
 136+ container1.all(),
137137 [item2, item3, item1],
138138 'es.ModelContainer.insertBefore moves item before another'
139139 );
140140
141141 container2.prepend( item1 );
142 - deepEqual( container2.items(), [item1], 'es.ModelContainer.prepend adds item to begining' );
 142+ deepEqual( container2.all(), [item1], 'es.ModelContainer.prepend adds item to begining' );
143143 container2.append( item3 );
144 - deepEqual( container2.items(), [item1, item3], 'es.ModelContainer.append adds item to end' );
 144+ deepEqual( container2.all(), [item1, item3], 'es.ModelContainer.append adds item to end' );
145145 container2.insertAfter( item2, item1 );
146146 deepEqual(
147 - container2.items(),
 147+ container2.all(),
148148 [item1, item2, item3],
149149 'es.ModelContainer.insertAfter inserts item after another'
150150 );
151151 container2.insertAfter( item1, item2 );
152152 deepEqual(
153 - container2.items(),
 153+ container2.all(),
154154 [item2, item1, item3],
155155 'es.ModelContainer.insertAfter moves item after another'
156156 );
Index: trunk/parsers/wikidom/lib/synth/bases/es.ModelContainer.js
@@ -40,7 +40,7 @@
4141 * @method
4242 * @returns {Array} List of all items.
4343 */
44 -es.ModelContainer.prototype.items = function() {
 44+es.ModelContainer.prototype.all = function() {
4545 return this[this._listName];
4646 };
4747
Index: trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js
@@ -75,7 +75,7 @@
7676 container.emit( 'update' );
7777 } );
7878 // Auto-add views for existing items
79 - var itemModels = this.containerModel.items();
 79+ var itemModels = this.containerModel.all();
8080 for ( var i = 0; i < itemModels.length; i++ ) {
8181 this.views.push( this.createItemView( itemModels[i] ) );
8282 }

Status & tagging log