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

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

Issue 11896013: Add List.reversed to give a reverse fixed-length view of a list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moved some functionality to separate CL. Created 7 years, 11 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
« no previous file with comments | « sdk/lib/collection_dev/list.dart ('k') | sdk/lib/core/list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/errors.dart
diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
index 59f30d039198f5e711bdeaaea11d486aa1ce8067..92f313f0717d5ea70bb49ba94ed18ada9b329311 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.dart
@@ -93,6 +93,10 @@ class RangeError extends ArgumentError {
/** Create a new [RangeError] with a message for the given [value]. */
RangeError.value(num value) : super("value $value");
+ /** Create a new [RangeError] with a message for a value and a range. */
+ RangeError.range(num value, num start, num end)
+ : super("value $value not in range $start..$end");
+
String toString() => "RangeError: $message";
}
@@ -238,6 +242,29 @@ class StateError implements Error {
}
+/**
+ * Error occurring when a collection is modified during iteration.
+ *
+ * Some modifications may be allowed for some collections, so each collection
+ * ([Iterable] or similar collection of values) should declare which operations
+ * are allowed during an iteration.
+ */
+class ConcurrentModificationError implements Error {
+ /** The object that was modified in an incompatible way. */
+ final Object modifiedObject;
+
+ const ConcurrentModificationError([this.modifiedObject]);
+
+ String toString() {
+ if (modifiedObject == null) {
+ return "Concurrent modification during iteration.";
+ }
+ return "Concurrent modification during iteration: "
+ "${Error.safeToString(modifiedObject)}.";
+ }
+}
+
+
class OutOfMemoryError implements Error {
const OutOfMemoryError();
String toString() => "Out of Memory";
« no previous file with comments | « sdk/lib/collection_dev/list.dart ('k') | sdk/lib/core/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698