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

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

Issue 124753002: Code cleanup (mostly io lib and some http lib). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head. Created 6 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
Index: sdk/lib/io/common.dart
diff --git a/sdk/lib/io/common.dart b/sdk/lib/io/common.dart
index 94b932a2f28c4f854f3bba42f5565446f3c34ee7..ea355801147789b965aafbea16516674ce4680f8 100644
--- a/sdk/lib/io/common.dart
+++ b/sdk/lib/io/common.dart
@@ -16,9 +16,8 @@ const int _OSERROR_RESPONSE_ERROR_CODE = 1;
const int _OSERROR_RESPONSE_MESSAGE = 2;
// Functions used to receive exceptions from native ports.
-bool _isErrorResponse(response) {
- return response is List && response[0] != _SUCCESS_RESPONSE;
-}
+bool _isErrorResponse(response) =>
+ response is List && response[0] != _SUCCESS_RESPONSE;
/**
* Returns an Exception or an Error
@@ -54,46 +53,46 @@ class OSError {
/** Constant used to indicate that no OS error code is available. */
static const int noErrorCode = -1;
+ /**
+ * Error message supplied by the operating system. null if no message is
+ * associated with the error.
+ */
+ final String message;
+
+ /**
+ * Error code supplied by the operating system. Will have the value
+ * [noErrorCode] if there is no error code associated with the error.
+ */
+ final int errorCode;
+
/** Creates an OSError object from a message and an errorCode. */
- const OSError([String this.message = "", int this.errorCode = noErrorCode]);
+ const OSError([this.message = "", this.errorCode = noErrorCode]);
/** Converts an OSError object to a string representation. */
String toString() {
StringBuffer sb = new StringBuffer();
sb.write("OS Error");
if (!message.isEmpty) {
- sb.write(": ");
- sb.write(message);
+ sb..write(": ")
+ ..write(message);
if (errorCode != noErrorCode) {
- sb.write(", errno = ");
- sb.write(errorCode.toString());
+ sb..write(", errno = ")
+ ..write(errorCode.toString());
}
} else if (errorCode != noErrorCode) {
- sb.write(": errno = ");
- sb.write(errorCode.toString());
+ sb..write(": errno = ")
+ ..write(errorCode.toString());
}
return sb.toString();
}
-
- /**
- * Error message supplied by the operating system. null if no message is
- * associated with the error.
- */
- final String message;
-
- /**
- * Error code supplied by the operating system. Will have the value
- * [noErrorCode] if there is no error code associated with the error.
- */
- final int errorCode;
}
// Object for holding a buffer and an offset.
class _BufferAndStart {
- _BufferAndStart(List this.buffer, int this.start);
List buffer;
int start;
+ _BufferAndStart(this.buffer, this.start);
}
// Ensure that the input List can be serialized through a native port.
« no previous file with comments | « runtime/include/dart_api.h ('k') | sdk/lib/io/crypto.dart » ('j') | sdk/lib/io/http_date.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698