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

Side by Side Diff: client/observable/observable.dart

Issue 8680038: Revert initializing formals change in client code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 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 | « client/layout/SizingFunctions.dart ('k') | client/samples/swarm/DataSource.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) 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 /** Whether this object is currently observed by listeners or propagators. */ 53 /** Whether this object is currently observed by listeners or propagators. */
54 bool get isObserved() { 54 bool get isObserved() {
55 for (Observable obj = this; obj != null; obj = obj.parent) { 55 for (Observable obj = this; obj != null; obj = obj.parent) {
56 if (listeners.length > 0) { 56 if (listeners.length > 0) {
57 return true; 57 return true;
58 } 58 }
59 } 59 }
60 return false; 60 return false;
61 } 61 }
62 62
63 AbstractObservable([Observable parent = null]) 63 AbstractObservable([Observable this.parent = null])
64 : this.parent = parent, 64 : uid = EventBatch.genUid(),
65 uid = EventBatch.genUid(),
66 listeners = new List<ChangeListener>(); 65 listeners = new List<ChangeListener>();
67 66
68 bool addChangeListener(ChangeListener listener) { 67 bool addChangeListener(ChangeListener listener) {
69 if (listeners.indexOf(listener, 0) == -1) { 68 if (listeners.indexOf(listener, 0) == -1) {
70 listeners.add(listener); 69 listeners.add(listener);
71 return true; 70 return true;
72 } 71 }
73 72
74 return false; 73 return false;
75 } 74 }
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 // equality check should be done? 289 // equality check should be done?
291 if (newValue !== _value) { 290 if (newValue !== _value) {
292 final oldValue = _value; 291 final oldValue = _value;
293 _value = newValue; 292 _value = newValue;
294 recordPropertyUpdate("value", newValue, oldValue); 293 recordPropertyUpdate("value", newValue, oldValue);
295 } 294 }
296 } 295 }
297 296
298 T _value; 297 T _value;
299 } 298 }
OLDNEW
« no previous file with comments | « client/layout/SizingFunctions.dart ('k') | client/samples/swarm/DataSource.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698