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

Unified Diff: tools/dom/src/WrappedList.dart

Issue 1894713002: Strong html (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ptal Created 4 years, 8 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 | « tools/dom/src/NodeValidatorBuilder.dart ('k') | tools/dom/src/dart2js_CssClassSet.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/WrappedList.dart
diff --git a/tools/dom/src/WrappedList.dart b/tools/dom/src/WrappedList.dart
index fd3ca952afab0e1ffdf723482ceb75c971742975..4cd72260bd33423b45a0b643738576f187999898 100644
--- a/tools/dom/src/WrappedList.dart
+++ b/tools/dom/src/WrappedList.dart
@@ -10,7 +10,7 @@ part of dart.dom.html;
*/
class _WrappedList<E extends Node> extends ListBase<E>
implements NodeListWrapper {
- final List _list;
+ final List<Node> _list;
_WrappedList(this._list);
@@ -30,13 +30,13 @@ class _WrappedList<E extends Node> extends ListBase<E>
// List APIs
- E operator [](int index) => _list[index];
+ E operator [](int index) => _list[index] as E;
void operator []=(int index, E value) { _list[index] = value; }
set length(int newLength) { _list.length = newLength; }
- void sort([int compare(E a, E b)]) { _list.sort(compare); }
+ void sort([int compare(E a, E b)]) { _list.sort((Node a, Node b) => compare(a as E, b as E)); }
int indexOf(Object element, [int start = 0]) => _list.indexOf(element, start);
@@ -44,7 +44,7 @@ class _WrappedList<E extends Node> extends ListBase<E>
void insert(int index, E element) => _list.insert(index, element);
- E removeAt(int index) => _list.removeAt(index);
+ E removeAt(int index) => _list.removeAt(index) as E;
void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
_list.setRange(start, end, iterable, skipCount);
@@ -67,7 +67,7 @@ class _WrappedList<E extends Node> extends ListBase<E>
* Iterator wrapper for _WrappedList.
*/
class _WrappedIterator<E> implements Iterator<E> {
- Iterator _iterator;
+ Iterator<Node> _iterator;
_WrappedIterator(this._iterator);
@@ -75,5 +75,5 @@ class _WrappedIterator<E> implements Iterator<E> {
return _iterator.moveNext();
}
- E get current => _iterator.current;
+ E get current => _iterator.current as E;
}
« no previous file with comments | « tools/dom/src/NodeValidatorBuilder.dart ('k') | tools/dom/src/dart2js_CssClassSet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698