| Index: sdk/lib/core/errors.dart
|
| diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
|
| index 0ac18808e643191f51e96665a57656df8ad4e2bf..fd46ee4d3405fbb30b942445f896959704fd46b0 100644
|
| --- a/sdk/lib/core/errors.dart
|
| +++ b/sdk/lib/core/errors.dart
|
| @@ -297,18 +297,25 @@ class RangeError extends ArgumentError {
|
| *
|
| * The [startName] and [endName] defaults to `"start"` and `"end"`,
|
| * respectively.
|
| + *
|
| + * Returns the actual `end` value, which is `length` if `end` is `null`,
|
| + * and `end` otherwise.
|
| */
|
| - static void checkValidRange(int start, int end, int length,
|
| + static int checkValidRange(int start, int end, int length,
|
| [String startName, String endName,
|
| String message]) {
|
| if (start < 0 || start > length) {
|
| if (startName == null) startName = "start";
|
| throw new RangeError.range(start, 0, length, startName, message);
|
| }
|
| - if (end != null && (end < start || end > length)) {
|
| - if (endName == null) endName = "end";
|
| - throw new RangeError.range(end, start, length, endName, message);
|
| + if (end != null) {
|
| + if (end < start || end > length) {
|
| + if (endName == null) endName = "end";
|
| + throw new RangeError.range(end, start, length, endName, message);
|
| + }
|
| + return end;
|
| }
|
| + return length;
|
| }
|
|
|
| /**
|
|
|