Index: runtime/lib/collection_patch.dart |
diff --git a/runtime/lib/collection_patch.dart b/runtime/lib/collection_patch.dart |
index 9f0c74fad4a7efd0bc94e22c91b32e61cbf21786..51934d052db5d296281966b41fa6769d39d0e31b 100644 |
--- a/runtime/lib/collection_patch.dart |
+++ b/runtime/lib/collection_patch.dart |
@@ -569,6 +569,17 @@ class _HashSet<E> extends _HashSetBase<E> implements HashSet<E> { |
return false; |
} |
+ E lookup(Object object) { |
+ int index = _hashCode(object) & (_buckets.length - 1); |
+ HashSetEntry entry = _buckets[index]; |
+ while (entry != null) { |
+ var key = entry.key; |
+ if (_equals(key, object)) return key; |
+ entry = entry.next; |
+ } |
+ return null; |
+ } |
+ |
// Set. |
void add(E element) { |
@@ -724,6 +735,11 @@ class _CustomHashSet<E> extends _HashSet<E> { |
return super.contains(element); |
} |
+ E lookup(Object element) { |
+ if (!_validKey(element)) return null; |
+ return super.lookup(element); |
+ } |
+ |
bool containsAll(Iterable<Object> elements) { |
for (Object element in elements) { |
if (!_validKey(element) || !this.contains(element)) return false; |
@@ -1180,6 +1196,11 @@ class _LinkedCustomHashSet<E> extends _LinkedHashSet<E> { |
return super.contains(o); |
} |
+ E lookup(Object o) { |
+ if (!_validKey(o)) return null; |
+ return super.lookup(o); |
+ } |
+ |
bool remove(Object o) { |
if (!_validKey(o)) return false; |
return super.remove(o); |