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

Unified Diff: runtime/bin/file_impl.dart

Issue 11275042: Renaming IndexOutOfRangeException to RangeError. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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: runtime/bin/file_impl.dart
diff --git a/runtime/bin/file_impl.dart b/runtime/bin/file_impl.dart
index 0aa31fb0291a2ec2602b7a9c2b002804d072e117..e6a911f09eb7998037c7995b03d0581926de47d5 100644
--- a/runtime/bin/file_impl.dart
+++ b/runtime/bin/file_impl.dart
@@ -198,7 +198,7 @@ class _FileOutputStream extends _BaseOutputStream implements OutputStream {
// A copy is required by the interface.
var length = buffer.length - offset;
if (len != null) {
- if (len > length) throw new IndexOutOfRangeException(len);
+ if (len > length) throw new RangeError(len);
length = len;
}
var copy = new Uint8List(length);
@@ -769,10 +769,10 @@ class _RandomAccessFile extends _FileBase implements RandomAccessFile {
}
static void _checkReadWriteListArguments(int length, int offset, int bytes) {
- if (offset < 0) throw new IndexOutOfRangeException(offset);
- if (bytes < 0) throw new IndexOutOfRangeException(bytes);
+ if (offset < 0) throw new RangeError(offset);
+ if (bytes < 0) throw new RangeError(bytes);
if ((offset + bytes) > length) {
- throw new IndexOutOfRangeException(offset + bytes);
+ throw new RangeError(offset + bytes);
}
}

Powered by Google App Engine
This is Rietveld 408576698