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

Unified Diff: sdk/lib/core/errors.dart

Issue 1318943005: Update range errors to agree on the numbers. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/core/errors.dart
diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
index 0e99b0b271ce48375f613c2fc9522aad6d0e5019..ad940cf83843522db98d5e4d258e653d4b5fa74b 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.dart
@@ -396,6 +396,8 @@ class IndexError extends ArgumentError implements RangeError {
var explanation = ": index should be less than $length";
if (invalidValue < 0) {
explanation = ": index must not be negative";
+ } else if (length == 0) {
+ explanation = ": list is empty";
floitsch 2015/09/08 10:54:19 I don't think we should make the assumption that t
Lasse Reichstein Nielsen 2015/09/08 11:38:03 Good point, reworded.
}
return explanation;
}

Powered by Google App Engine
This is Rietveld 408576698