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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 9 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: tools/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 0688fe1d06808d83c82adadfeb2c06427b22db1c..a5b8cb6a911e14470e0f2e0a57ef3a93108f59ac 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -201,9 +201,13 @@ class _ChildrenElementList implements List {
throw new UnimplementedError();
}
+ List sublist(int start, [int end]) {
+ if (end == null) end = length;
+ return new _FrozenElementList._wrap(Lists.getRange(this, start, end, []));
+ }
+
List getRange(int start, int rangeLength) =>
- new _FrozenElementList._wrap(Lists.getRange(this, start, rangeLength,
- []));
+ sublist(start, start + rangeLength);
int indexOf(Element element, [int start = 0]) {
return Lists.indexOf(this, element, start, this.length);
@@ -422,8 +426,12 @@ class _FrozenElementList implements List {
throw new UnsupportedError('');
}
+ List<Element> sublist(int start, [int end]) {
+ return new _FrozenElementList._wrap(_nodeList.sublist(start, end));
+ }
+
List<Element> getRange(int start, int rangeLength) =>
- new _FrozenElementList._wrap(_nodeList.getRange(start, rangeLength));
+ sublist(start, start + rangeLength);
int indexOf(Element element, [int start = 0]) =>
_nodeList.indexOf(element, start);

Powered by Google App Engine
This is Rietveld 408576698