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

Side by Side Diff: pkg/observe/lib/src/compound_binding.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/change_record.dart ('k') | pkg/observe/lib/src/list_path_observer.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.compound_binding;
6
7 import 'dart:async';
8 import 'package:observe/observe.dart';
6 9
7 /** The callback used in the [CompoundBinding.combinator] field. */ 10 /** The callback used in the [CompoundBinding.combinator] field. */
8 typedef Object CompoundBindingCombinator(Map objects); 11 typedef Object CompoundBindingCombinator(Map objects);
9 12
10 /** 13 /**
11 * CompoundBinding is an object which knows how to listen to multiple path 14 * CompoundBinding is an object which knows how to listen to multiple path
12 * values (registered via [bind]) and invoke its [combinator] when one or more 15 * values (registered via [bind]) and invoke its [combinator] when one or more
13 * of the values have changed and set its [value] property to the return value 16 * of the values have changed and set its [value] property to the return value
14 * of the function. When any value has changed, all current values are provided 17 * of the function. When any value has changed, all current values are provided
15 * to the [combinator] in the single `values` argument. 18 * to the [combinator] in the single `values` argument.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 */ 125 */
123 void close() { 126 void close() {
124 for (var binding in _observers.values) { 127 for (var binding in _observers.values) {
125 binding.cancel(); 128 binding.cancel();
126 } 129 }
127 _observers.clear(); 130 _observers.clear();
128 _values.clear(); 131 _values.clear();
129 value = null; 132 value = null;
130 } 133 }
131 134
132 _unobserved() => close(); 135 unobserved() => close();
133 } 136 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/change_record.dart ('k') | pkg/observe/lib/src/list_path_observer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698