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); |
} |
} |