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

Unified Diff: sdk/lib/async/async_error.dart

Issue 12393009: Change and structure how Stream implementations do callbacks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | sdk/lib/async/stream.dart » ('j') | sdk/lib/async/stream.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/async_error.dart
diff --git a/sdk/lib/async/async_error.dart b/sdk/lib/async/async_error.dart
index 81a1e0410d0025cd903c3626269c5f8cb691fd2f..fa90e8779b1042a31981f5ee19ed926be0b36df3 100644
--- a/sdk/lib/async/async_error.dart
+++ b/sdk/lib/async/async_error.dart
@@ -20,30 +20,29 @@ class AsyncError {
AsyncError(this.error, [this.stackTrace]): cause = null;
AsyncError.withCause(this.error, this.stackTrace, this.cause);
- void _writeOn(StringBuffer buffer) {
- buffer.add("'");
+ void _writeOn(StringSink buffer) {
+ buffer.write("'");
String message;
try {
message = error.toString();
} catch (e) {
message = Error.safeToString(error);
}
- buffer.add(message);
- buffer.add("'\n");
+ buffer.write(message);
+ buffer.write("'\n");
if (stackTrace != null) {
- buffer.add("Stack trace:\n");
- buffer.add(stackTrace.toString());
- buffer.add("\n");
+ buffer.write("Stack trace:\n");
+ buffer.writeln(stackTrace.toString());
}
}
String toString() {
StringBuffer buffer = new StringBuffer();
- buffer.add("AsyncError: ");
+ buffer.write("AsyncError: ");
_writeOn(buffer);
AsyncError cause = this.cause;
while (cause != null) {
- buffer.add("Caused by: ");
+ buffer.write("Caused by: ");
cause._writeOn(buffer);
cause = cause.cause;
}
« no previous file with comments | « no previous file | sdk/lib/async/stream.dart » ('j') | sdk/lib/async/stream.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698