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

Unified Diff: runtime/bin/file_impl.dart

Issue 10537053: Remove erroneous assert from dart:io's File class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: move blank line Created 8 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_impl.dart
diff --git a/runtime/bin/file_impl.dart b/runtime/bin/file_impl.dart
index 692a08b6bcd50b8c22ffe93dd0d84685c2ebcbb0..0706fbe468a31b7e6c82977d52af36364a7f3737 100644
--- a/runtime/bin/file_impl.dart
+++ b/runtime/bin/file_impl.dart
@@ -39,9 +39,13 @@ class _FileInputStream extends _BaseDataInputStream implements InputStream {
Future<int> _fillBuffer() {
Expect.equals(_position, _data.length);
- Expect.isTrue(_filePosition < _fileLength);
int size = Math.min(_bufferLength, _fileLength - _filePosition);
+ if (size == 0) {
+ _streamMarkedClosed = true;
+ _openedFile.close();
+ return new Future.immediate(0);
+ }
if (_data.length != size) {
_data = new Uint8List(size);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698