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

Unified Diff: sdk/lib/html/html_common/filtered_element_list.dart

Issue 14246008: Allow Object when doing lookups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type error. 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
Index: sdk/lib/html/html_common/filtered_element_list.dart
diff --git a/sdk/lib/html/html_common/filtered_element_list.dart b/sdk/lib/html/html_common/filtered_element_list.dart
index 61954e6b2ea19e421cbbc46c4698b0d0520d01b1..53df05a7cee01d2961faf9a96b560787bb43f4c5 100644
--- a/sdk/lib/html/html_common/filtered_element_list.dart
+++ b/sdk/lib/html/html_common/filtered_element_list.dart
@@ -59,8 +59,10 @@ class FilteredElementList<T extends Element> extends ListBase<T> {
}
}
- bool contains(Element element) {
- return (element != null) && (element.parentNode == _node);
+ bool contains(Object needle) {
+ if (needle != Element) return false;
+ Element element = needle;
+ return element.parentNode == _node;
}
Iterable<Element> get reversed => _filtered.reversed;

Powered by Google App Engine
This is Rietveld 408576698