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

Unified Diff: sdk/lib/io/file_impl.dart

Issue 1156993003: Fix argument processing for RandomAccessFile.writeFrom (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Removed async from sync function Created 5 years, 7 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 | tests/standalone/io/file_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file_impl.dart
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index 2dac1b84d7e65a741a43b8423456b621fc2807ab..72731b2ff3be1cf039c39f31116d3e4b7041a81f 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -772,7 +772,10 @@ class _RandomAccessFile
(end != null && end is !int)) {
throw new ArgumentError("Invalid arguments to writeFrom");
}
-
+ if (start == null) start = 0;
Lasse Reichstein Nielsen 2015/05/26 11:20:12 Why not just make 0 the default value for the `sta
Søren Gjesse 2015/05/26 14:51:15 Done. _checkReadWriteListArguments actually just c
+ if (end == null) end = buffer.length;
+ if (end == start) return;
+ _checkReadWriteListArguments(buffer.length, start, end);
_BufferAndStart result;
try {
result = _ensureFastAndSerializableByteData(buffer, start, end);
« no previous file with comments | « no previous file | tests/standalone/io/file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698