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

Side by Side Diff: samples/ui_lib/observable/observable.dart

Issue 11273041: Make first and last getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. 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
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 #import('dart:coreimpl'); 7 #import('dart:coreimpl');
8 8
9 #source('ChangeEvent.dart'); 9 #source('ChangeEvent.dart');
10 #source('EventBatch.dart'); 10 #source('EventBatch.dart');
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 add(element); 179 add(element);
180 } 180 }
181 } 181 }
182 182
183 int push(T element) { 183 int push(T element) {
184 recordListInsert(length, element); 184 recordListInsert(length, element);
185 _internal.add(element); 185 _internal.add(element);
186 return _internal.length; 186 return _internal.length;
187 } 187 }
188 188
189 T last() => _internal.last(); 189 T get last => _internal.last;
190 190
191 T removeLast() { 191 T removeLast() {
192 final result = _internal.removeLast(); 192 final result = _internal.removeLast();
193 recordListRemove(length, result); 193 recordListRemove(length, result);
194 return result; 194 return result;
195 } 195 }
196 196
197 T removeAt(int index) { 197 T removeAt(int index) {
198 int i = 0; 198 int i = 0;
199 T found = null; 199 T found = null;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 // equality check should be done? 290 // equality check should be done?
291 if (newValue !== _value) { 291 if (newValue !== _value) {
292 final oldValue = _value; 292 final oldValue = _value;
293 _value = newValue; 293 _value = newValue;
294 recordPropertyUpdate("value", newValue, oldValue); 294 recordPropertyUpdate("value", newValue, oldValue);
295 } 295 }
296 } 296 }
297 297
298 T _value; 298 T _value;
299 } 299 }
OLDNEW
« no previous file with comments | « samples/third_party/dromaeo/tests/dom-traverse-htmlidiomatic.dart ('k') | samples/ui_lib/touch/Momentum.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698