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

Side by Side Diff: sdk/lib/async/stream_transformers.dart

Issue 1302363003: Forward stack traces through stream transformers. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.async; 5 part of dart.async;
6 6
7 /** 7 /**
8 * Wraps an [_EventSink] so it exposes only the [EventSink] interface. 8 * Wraps an [_EventSink] so it exposes only the [EventSink] interface.
9 */ 9 */
10 class _EventSinkWrapper<T> implements EventSink<T> { 10 class _EventSinkWrapper<T> implements EventSink<T> {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 243 }
244 244
245 /** Default data handler forwards all data. */ 245 /** Default data handler forwards all data. */
246 static void _defaultHandleData(var data, EventSink sink) { 246 static void _defaultHandleData(var data, EventSink sink) {
247 sink.add(data); 247 sink.add(data);
248 } 248 }
249 249
250 /** Default error handler forwards all errors. */ 250 /** Default error handler forwards all errors. */
251 static void _defaultHandleError(error, StackTrace stackTrace, 251 static void _defaultHandleError(error, StackTrace stackTrace,
252 EventSink sink) { 252 EventSink sink) {
253 sink.addError(error); 253 sink.addError(error, stackTrace);
254 } 254 }
255 255
256 /** Default done handler forwards done. */ 256 /** Default done handler forwards done. */
257 static void _defaultHandleDone(EventSink sink) { 257 static void _defaultHandleDone(EventSink sink) {
258 sink.close(); 258 sink.close();
259 } 259 }
260 } 260 }
261 261
262 /// A closure mapping a stream and cancelOnError to a StreamSubscription. 262 /// A closure mapping a stream and cancelOnError to a StreamSubscription.
263 typedef StreamSubscription<T> _SubscriptionTransformer<S, T>( 263 typedef StreamSubscription<T> _SubscriptionTransformer<S, T>(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 void onDone(), 302 void onDone(),
303 bool cancelOnError }) { 303 bool cancelOnError }) {
304 cancelOnError = identical(true, cancelOnError); 304 cancelOnError = identical(true, cancelOnError);
305 StreamSubscription<T> result = _transformer(_stream, cancelOnError); 305 StreamSubscription<T> result = _transformer(_stream, cancelOnError);
306 result.onData(onData); 306 result.onData(onData);
307 result.onError(onError); 307 result.onError(onError);
308 result.onDone(onDone); 308 result.onDone(onDone);
309 return result; 309 return result;
310 } 310 }
311 } 311 }
OLDNEW
« 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