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

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

Issue 11269004: Change List.sort to not have a default parameter value. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reverted used of ?compare Created 8 years 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 part 'ChangeEvent.dart'; 7 part 'ChangeEvent.dart';
8 part 'EventBatch.dart'; 8 part 'EventBatch.dart';
9 9
10 /** 10 /**
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 void set length(int value) { 151 void set length(int value) {
152 _internal.length = value; 152 _internal.length = value;
153 recordGlobalChange(); 153 recordGlobalChange();
154 } 154 }
155 155
156 void clear() { 156 void clear() {
157 _internal.clear(); 157 _internal.clear();
158 recordGlobalChange(); 158 recordGlobalChange();
159 } 159 }
160 160
161 void sort([Comparator compare = Comparable.compare]) { 161 void sort([int compare(var a, var b)]) {
162 if (compare == null) compare = Comparable.compare;
162 _internal.sort(compare); 163 _internal.sort(compare);
163 recordGlobalChange(); 164 recordGlobalChange();
164 } 165 }
165 166
166 void add(T element) { 167 void add(T element) {
167 recordListInsert(length, element); 168 recordListInsert(length, element);
168 _internal.add(element); 169 _internal.add(element);
169 } 170 }
170 171
171 void addLast(T element) { 172 void addLast(T element) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // Only fire on an actual change. 287 // Only fire on an actual change.
287 if (!identical(newValue, _value)) { 288 if (!identical(newValue, _value)) {
288 final oldValue = _value; 289 final oldValue = _value;
289 _value = newValue; 290 _value = newValue;
290 recordPropertyUpdate("value", newValue, oldValue); 291 recordPropertyUpdate("value", newValue, oldValue);
291 } 292 }
292 } 293 }
293 294
294 T _value; 295 T _value;
295 } 296 }
OLDNEW
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698