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

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

Issue 26734004: use symbol literals instead of const ctor in packages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months 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_notifier.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 part of observe;
6 6
7 /** The callback used in the [CompoundBinding.combinator] field. */ 7 /** The callback used in the [CompoundBinding.combinator] field. */
8 typedef Object CompoundBindingCombinator(Map objects); 8 typedef Object CompoundBindingCombinator(Map objects);
9 9
10 /** 10 /**
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 this.combinator = combinator; 58 this.combinator = combinator;
59 } 59 }
60 60
61 CompoundBindingCombinator get combinator => _combinator; 61 CompoundBindingCombinator get combinator => _combinator;
62 62
63 set combinator(CompoundBindingCombinator combinator) { 63 set combinator(CompoundBindingCombinator combinator) {
64 _combinator = combinator; 64 _combinator = combinator;
65 if (combinator != null) _scheduleResolve(); 65 if (combinator != null) _scheduleResolve();
66 } 66 }
67 67
68 static const _VALUE = const Symbol('value');
69
70 get value => _value; 68 get value => _value;
71 69
72 int get length => _observers.length; 70 int get length => _observers.length;
73 71
74 void set value(newValue) { 72 void set value(newValue) {
75 _value = notifyPropertyChange(_VALUE, _value, newValue); 73 _value = notifyPropertyChange(#value, _value, newValue);
76 } 74 }
77 75
78 void bind(name, model, String path) { 76 void bind(name, model, String path) {
79 unbind(name); 77 unbind(name);
80 78
81 // TODO(jmesserly): should we delay observing until we are observed, 79 // TODO(jmesserly): should we delay observing until we are observed,
82 // similar to PathObserver? 80 // similar to PathObserver?
83 _observers[name] = new PathObserver(model, path).bindSync((value) { 81 _observers[name] = new PathObserver(model, path).bindSync((value) {
84 _values[name] = value; 82 _values[name] = value;
85 _scheduleResolve(); 83 _scheduleResolve();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 for (var binding in _observers.values) { 124 for (var binding in _observers.values) {
127 binding.cancel(); 125 binding.cancel();
128 } 126 }
129 _observers.clear(); 127 _observers.clear();
130 _values.clear(); 128 _values.clear();
131 value = null; 129 value = null;
132 } 130 }
133 131
134 _unobserved() => close(); 132 _unobserved() => close();
135 } 133 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/change_notifier.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