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: sdk/lib/html/html_common/filtered_element_list.dart

Issue 1230313008: Another try at placating the type checking for FilteredElementList (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10beaf747fe19369b6f5cfb3b7ef2dd448ef115e..1a55d79284ebd17580d622b4ab7da9e0a0f5ad22 100644
--- a/sdk/lib/html/html_common/filtered_element_list.dart
+++ b/sdk/lib/html/html_common/filtered_element_list.dart
@@ -28,9 +28,10 @@ class FilteredElementList extends ListBase<Element> implements NodeListWrapper {
// with externally to this class.
//
// We can't use where directly because the types don't agree and there's
- // no way to cast it, so take advantage of being in the SDK.
+ // no way to cast it, so take advantage of being in the SDK to construct
+ // a WhereIterable directly. Even so it has to be of dynamic.
Iterable<Element> get _iterable =>
- new WhereIterable<Element>(_childNodes, (n) => n is Element);
+ new WhereIterable(_childNodes, (n) => n is Element);
List<Element> get _filtered =>
new List<Element>.from(_iterable, growable: false);
@@ -136,7 +137,7 @@ class FilteredElementList extends ListBase<Element> implements NodeListWrapper {
bool remove(Object element) {
if (element is! Element) return false;
if (contains(element)) {
- element.remove();
+ (element as Element).remove(); // Placate the type checker
return true;
} else {
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698