Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Side by Side Diff: samples/swarm/swarm_ui_lib/observable/observable.dart

Issue 11299048: Revert "Add List.first." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/core/list.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library observable; 5 library observable;
6 6
7 part 'ChangeEvent.dart'; 7 part 'ChangeEvent.dart';
8 part 'EventBatch.dart'; 8 part 'EventBatch.dart';
9 9
10 /** 10 /**
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 add(element); 177 add(element);
178 } 178 }
179 } 179 }
180 180
181 int push(T element) { 181 int push(T element) {
182 recordListInsert(length, element); 182 recordListInsert(length, element);
183 _internal.add(element); 183 _internal.add(element);
184 return _internal.length; 184 return _internal.length;
185 } 185 }
186 186
187 T get first => _internal.first;
188 T get last => _internal.last; 187 T get last => _internal.last;
189 188
190 T removeLast() { 189 T removeLast() {
191 final result = _internal.removeLast(); 190 final result = _internal.removeLast();
192 recordListRemove(length, result); 191 recordListRemove(length, result);
193 return result; 192 return result;
194 } 193 }
195 194
196 T removeAt(int index) { 195 T removeAt(int index) {
197 int i = 0; 196 int i = 0;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // Only fire on an actual change. 285 // Only fire on an actual change.
287 if (!identical(newValue, _value)) { 286 if (!identical(newValue, _value)) {
288 final oldValue = _value; 287 final oldValue = _value;
289 _value = newValue; 288 _value = newValue;
290 recordPropertyUpdate("value", newValue, oldValue); 289 recordPropertyUpdate("value", newValue, oldValue);
291 } 290 }
292 } 291 }
293 292
294 T _value; 293 T _value;
295 } 294 }
OLDNEW
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/core/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698