Skip to content

Commit 8d0ceaa

Browse files
committed
Another try at placating the type checking for FilteredElementList
BUG= Review URL: https://codereview.chromium.org//1230313008 .
1 parent 23f96f1 commit 8d0ceaa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sdk/lib/html/html_common/filtered_element_list.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ class FilteredElementList extends ListBase<Element> implements NodeListWrapper {
2828
// with externally to this class.
2929
//
3030
// We can't use where directly because the types don't agree and there's
31-
// no way to cast it, so take advantage of being in the SDK.
31+
// no way to cast it, so take advantage of being in the SDK to construct
32+
// a WhereIterable directly. Even so it has to be of dynamic.
3233
Iterable<Element> get _iterable =>
33-
new WhereIterable<Element>(_childNodes, (n) => n is Element);
34+
new WhereIterable(_childNodes, (n) => n is Element);
3435
List<Element> get _filtered =>
3536
new List<Element>.from(_iterable, growable: false);
3637

@@ -136,7 +137,7 @@ class FilteredElementList extends ListBase<Element> implements NodeListWrapper {
136137
bool remove(Object element) {
137138
if (element is! Element) return false;
138139
if (contains(element)) {
139-
element.remove();
140+
(element as Element).remove(); // Placate the type checker
140141
return true;
141142
} else {
142143
return false;

0 commit comments

Comments
 (0)