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

Unified Diff: pkg/observe/lib/src/observable_map.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/observe/lib/src/observable_list.dart ('k') | pkg/observe/lib/src/path_observer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/observe/lib/src/observable_map.dart
diff --git a/pkg/observe/lib/src/observable_map.dart b/pkg/observe/lib/src/observable_map.dart
index 621c86fa5afc413a2a4dea5cb009909153b93bb8..5f952ec7c62f370159add86329248092f815b088 100644
--- a/pkg/observe/lib/src/observable_map.dart
+++ b/pkg/observe/lib/src/observable_map.dart
@@ -44,8 +44,6 @@ class MapChangeRecord extends ChangeRecord {
* will be notified.
*/
class ObservableMap<K, V> extends ChangeNotifierBase implements Map<K, V> {
- static const _LENGTH = const Symbol('length');
-
final Map<K, V> _map;
/** Creates an observable map. */
@@ -104,7 +102,7 @@ class ObservableMap<K, V> extends ChangeNotifierBase implements Map<K, V> {
_map[key] = value;
if (hasObservers) {
if (len != _map.length) {
- notifyPropertyChange(_LENGTH, len, _map.length);
+ notifyPropertyChange(#length, len, _map.length);
notifyChange(new MapChangeRecord(key, isInsert: true));
} else if (!identical(oldValue, value)) {
notifyChange(new MapChangeRecord(key));
@@ -120,7 +118,7 @@ class ObservableMap<K, V> extends ChangeNotifierBase implements Map<K, V> {
int len = _map.length;
V result = _map.putIfAbsent(key, ifAbsent);
if (hasObservers && len != _map.length) {
- notifyPropertyChange(_LENGTH, len, _map.length);
+ notifyPropertyChange(#length, len, _map.length);
notifyChange(new MapChangeRecord(key, isInsert: true));
}
return result;
@@ -131,7 +129,7 @@ class ObservableMap<K, V> extends ChangeNotifierBase implements Map<K, V> {
V result = _map.remove(key);
if (hasObservers && len != _map.length) {
notifyChange(new MapChangeRecord(key, isRemove: true));
- notifyPropertyChange(_LENGTH, len, _map.length);
+ notifyPropertyChange(#length, len, _map.length);
}
return result;
}
@@ -142,7 +140,7 @@ class ObservableMap<K, V> extends ChangeNotifierBase implements Map<K, V> {
_map.forEach((key, value) {
notifyChange(new MapChangeRecord(key, isRemove: true));
});
- notifyPropertyChange(_LENGTH, len, 0);
+ notifyPropertyChange(#length, len, 0);
}
_map.clear();
}
« no previous file with comments | « pkg/observe/lib/src/observable_list.dart ('k') | pkg/observe/lib/src/path_observer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698