Chromium Code Reviews| Index: sdk/lib/core/errors.dart |
| diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart |
| index 0e99b0b271ce48375f613c2fc9522aad6d0e5019..30538071ec3fbde3792917087fe1a2b63df48e3b 100644 |
| --- a/sdk/lib/core/errors.dart |
| +++ b/sdk/lib/core/errors.dart |
| @@ -392,12 +392,13 @@ class IndexError extends ArgumentError implements RangeError { |
| String get _errorName => "RangeError"; |
|
sra1
2015/09/09 17:16:05
Was this supposed to be "IndexError"?
Lasse Reichstein Nielsen
2015/09/10 10:08:54
No, this was introduced as a helper class for a sp
|
| String get _errorExplanation { |
| assert(_hasValue); |
| - String target = Error.safeToString(indexable); |
| - var explanation = ": index should be less than $length"; |
| if (invalidValue < 0) { |
| - explanation = ": index must not be negative"; |
| + return ": index must not be negative"; |
| } |
| - return explanation; |
| + if (length == 0) { |
| + return ": no indices are valid"; |
|
sra1
2015/09/09 17:16:05
I find this a tiny bit confusing.
It would be nice
Lasse Reichstein Nielsen
2015/09/10 10:08:54
Exactly my problem (and what I started out saying)
|
| + } |
| + return ": index should be less than $length"; |
| } |
| } |