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

Side by Side Diff: pkg/observe/lib/src/observable_list.dart

Issue 51483002: fix PathObserver to avoid try+catch (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « pkg/observe/lib/src/observable_box.dart ('k') | pkg/observe/lib/src/observable_map.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of observe; 5 library observe.src.observable_list;
6
7 import 'dart:async';
8 import 'dart:collection' show ListBase;
9 import 'package:observe/observe.dart';
6 10
7 /** 11 /**
8 * Represents an observable list of model values. If any items are added, 12 * Represents an observable list of model values. If any items are added,
9 * removed, or replaced, then observers that are listening to [changes] 13 * removed, or replaced, then observers that are listening to [changes]
10 * will be notified. 14 * will be notified.
11 */ 15 */
12 class ObservableList<E> extends ListBase<E> with ChangeNotifier { 16 class ObservableList<E> extends ListBase<E> with ChangeNotifier {
13 List<ListChangeRecord> _listRecords; 17 List<ListChangeRecord> _listRecords;
14 18
15 /** The inner [List<E>] with the actual storage. */ 19 /** The inner [List<E>] with the actual storage. */
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 275
272 if (added > 0 || removed > 0) { 276 if (added > 0 || removed > 0) {
273 notifyChange(new ListChangeRecord(startIndex, addedCount: added, 277 notifyChange(new ListChangeRecord(startIndex, addedCount: added,
274 removedCount: removed)); 278 removedCount: removed));
275 } 279 }
276 280
277 offset += removed - added; 281 offset += removed - added;
278 } 282 }
279 } 283 }
280 } 284 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/observable_box.dart ('k') | pkg/observe/lib/src/observable_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698