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

Unified Diff: sdk/lib/_internal/lib/collection_patch.dart

Issue 14246008: Allow Object when doing lookups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to upload before committing Created 7 years, 6 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 | « sdk/lib/_collection_dev/list.dart ('k') | sdk/lib/_internal/lib/js_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/collection_patch.dart
diff --git a/sdk/lib/_internal/lib/collection_patch.dart b/sdk/lib/_internal/lib/collection_patch.dart
index 803c97e4a3f86f4860e3e197607a1b92b5a2e46e..3fb0f458df9291b0f8d34081170eae6c486071a9 100644
--- a/sdk/lib/_internal/lib/collection_patch.dart
+++ b/sdk/lib/_internal/lib/collection_patch.dart
@@ -40,7 +40,7 @@ patch class HashMap<K, V> {
return keys.map((each) => this[each]);
}
- patch bool containsKey(K key) {
+ patch bool containsKey(Object key) {
if (_isStringKey(key)) {
var strings = _strings;
return (strings == null) ? false : _hasTableEntry(strings, key);
@@ -55,7 +55,7 @@ patch class HashMap<K, V> {
}
}
- patch bool containsValue(V value) {
+ patch bool containsValue(Object value) {
return _computeKeys().any((each) => this[each] == value);
}
@@ -65,7 +65,7 @@ patch class HashMap<K, V> {
});
}
- patch V operator[](K key) {
+ patch V operator[](Object key) {
if (_isStringKey(key)) {
var strings = _strings;
return (strings == null) ? null : _getTableEntry(strings, key);
@@ -119,7 +119,7 @@ patch class HashMap<K, V> {
return value;
}
- patch V remove(K key) {
+ patch V remove(Object key) {
if (_isStringKey(key)) {
return _removeHashTableEntry(_strings, key);
} else if (_isNumericKey(key)) {
@@ -319,7 +319,7 @@ class HashMapKeyIterable<E> extends IterableBase<E> {
return new HashMapKeyIterator<E>(_map, _map._computeKeys());
}
- bool contains(E element) {
+ bool contains(Object element) {
return _map.containsKey(element);
}
@@ -403,7 +403,7 @@ patch class LinkedHashMap<K, V> {
return keys.map((each) => this[each]);
}
- patch bool containsKey(K key) {
+ patch bool containsKey(Object key) {
if (_isStringKey(key)) {
var strings = _strings;
if (strings == null) return false;
@@ -422,7 +422,7 @@ patch class LinkedHashMap<K, V> {
}
}
- patch bool containsValue(V value) {
+ patch bool containsValue(Object value) {
return keys.any((each) => this[each] == value);
}
@@ -432,7 +432,7 @@ patch class LinkedHashMap<K, V> {
});
}
- patch V operator[](K key) {
+ patch V operator[](Object key) {
if (_isStringKey(key)) {
var strings = _strings;
if (strings == null) return null;
@@ -491,7 +491,7 @@ patch class LinkedHashMap<K, V> {
return value;
}
- patch V remove(K key) {
+ patch V remove(Object key) {
if (_isStringKey(key)) {
return _removeHashTableEntry(_strings, key);
} else if (_isNumericKey(key)) {
@@ -673,7 +673,7 @@ class LinkedHashMapKeyIterable<E> extends IterableBase<E> {
return new LinkedHashMapKeyIterator<E>(_map, _map._modifications);
}
- bool contains(E element) {
+ bool contains(Object element) {
return _map.containsKey(element);
}
@@ -819,7 +819,7 @@ patch class HashSet<E> {
}
}
- patch void removeAll(Iterable objectsToRemove) {
+ patch void removeAll(Iterable<Object> objectsToRemove) {
for (var each in objectsToRemove) {
remove(each);
}
« no previous file with comments | « sdk/lib/_collection_dev/list.dart ('k') | sdk/lib/_internal/lib/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698