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

Unified Diff: sdk/lib/svg/dart2js/svg_dart2js.dart

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: sdk/lib/svg/dart2js/svg_dart2js.dart
diff --git a/sdk/lib/svg/dart2js/svg_dart2js.dart b/sdk/lib/svg/dart2js/svg_dart2js.dart
index 9e7f2c5f55aa12f1cbff3857cd2b200f4fabeda4..dea8a56e81ecd77ba25c42d9554d989ff32ff426 100644
--- a/sdk/lib/svg/dart2js/svg_dart2js.dart
+++ b/sdk/lib/svg/dart2js/svg_dart2js.dart
@@ -3231,8 +3231,13 @@ class LengthList implements JavaScriptIndexingBehavior, List<Length> native "*SV
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
+ List<Length> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ return Lists.getRange(this, start, end, <Length>[]);
+ }
+
List<Length> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <Length>[]);
+ sublist(start, start + rangeLength);
Map<int, Length> asMap() =>
IterableMixinWorkaround.asMapList(this);
@@ -3864,8 +3869,13 @@ class NumberList implements JavaScriptIndexingBehavior, List<Number> native "*SV
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
+ List<Number> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ return Lists.getRange(this, start, end, <Number>[]);
+ }
+
List<Number> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <Number>[]);
+ sublist(start, start + rangeLength);
Map<int, Number> asMap() =>
IterableMixinWorkaround.asMapList(this);
@@ -4773,8 +4783,13 @@ class PathSegList implements JavaScriptIndexingBehavior, List<PathSeg> native "*
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
+ List<PathSeg> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ return Lists.getRange(this, start, end, <PathSeg>[]);
+ }
+
List<PathSeg> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <PathSeg>[]);
+ sublist(start, start + rangeLength);
Map<int, PathSeg> asMap() =>
IterableMixinWorkaround.asMapList(this);
@@ -5667,8 +5682,13 @@ class StringList implements JavaScriptIndexingBehavior, List<String> native "*SV
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
+ List<String> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ return Lists.getRange(this, start, end, <String>[]);
+ }
+
List<String> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <String>[]);
+ sublist(start, start + rangeLength);
Map<int, String> asMap() =>
IterableMixinWorkaround.asMapList(this);
@@ -6838,8 +6858,13 @@ class TransformList implements List<Transform>, JavaScriptIndexingBehavior nativ
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
+ List<Transform> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ return Lists.getRange(this, start, end, <Transform>[]);
+ }
+
List<Transform> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <Transform>[]);
+ sublist(start, start + rangeLength);
Map<int, Transform> asMap() =>
IterableMixinWorkaround.asMapList(this);
@@ -7366,8 +7391,13 @@ class _ElementInstanceList implements JavaScriptIndexingBehavior, List<ElementIn
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
+ List<ElementInstance> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ return Lists.getRange(this, start, end, <ElementInstance>[]);
+ }
+
List<ElementInstance> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <ElementInstance>[]);
+ sublist(start, start + rangeLength);
Map<int, ElementInstance> asMap() =>
IterableMixinWorkaround.asMapList(this);

Powered by Google App Engine
This is Rietveld 408576698