Index: tools/dom/templates/immutable_list_mixin.darttemplate |
diff --git a/tools/dom/templates/immutable_list_mixin.darttemplate b/tools/dom/templates/immutable_list_mixin.darttemplate |
index 598fde2fded9eb6429a26642ffc5d5e82f3ba97d..11aed324df9b08185954f5a03f19aaafa533cd23 100644 |
--- a/tools/dom/templates/immutable_list_mixin.darttemplate |
+++ b/tools/dom/templates/immutable_list_mixin.darttemplate |
@@ -188,8 +188,13 @@ $endif |
throw new UnsupportedError("Cannot insertRange on immutable List."); |
} |
+ List<$E> sublist(int start, [int end]) { |
+ if (end == null) end = length; |
+ return Lists.getRange(this, start, end, <$E>[]); |
+ } |
+ |
List<$E> getRange(int start, int rangeLength) => |
- Lists.getRange(this, start, rangeLength, <$E>[]); |
+ sublist(start, start + rangeLength); |
Map<int, $E> asMap() => |
IterableMixinWorkaround.asMapList(this); |