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

Side by Side Diff: test/dart_codegen/expect/async/stream_controller.dart

Issue 1121993004: Inference through conditional expressions (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « test/checker/checker_test.dart ('k') | test/dart_codegen/expect/async/zone.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 part of dart.async; 1 part of dart.async;
2 abstract class StreamController<T> implements StreamSink<T> {Stream<T> get stre am; 2 abstract class StreamController<T> implements StreamSink<T> {Stream<T> get stre am;
3 factory StreamController({ 3 factory StreamController({
4 void onListen(), void onPause(), void onResume(), onCancel(), bool sync : fals e} 4 void onListen(), void onPause(), void onResume(), onCancel(), bool sync : fals e}
5 ) { 5 ) {
6 if (onListen == null && onPause == null && onResume == null && onCancel == nul l) { 6 if (onListen == null && onPause == null && onResume == null && onCancel == nul l) {
7 return ((__x46) => DEVC$RT.cast(__x46, DEVC$RT.type((_StreamController<dynam ic> _) { 7 return ((__x46) => DEVC$RT.cast(__x46, DEVC$RT.type((_StreamController<dynam ic> _) {
8 } 8 }
9 ), DEVC$RT.type((StreamController<T> _) { 9 ), DEVC$RT.type((StreamController<T> _) {
10 } 10 }
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 _target.addError(error, stackTrace); 339 _target.addError(error, stackTrace);
340 } 340 }
341 Future close() => _target.close(); 341 Future close() => _target.close();
342 Future addStream(Stream<T> source, { 342 Future addStream(Stream<T> source, {
343 bool cancelOnError : true} 343 bool cancelOnError : true}
344 ) => _target.addStream(source, cancelOnError: cancelOnError); 344 ) => _target.addStream(source, cancelOnError: cancelOnError);
345 Future get done => _target.done; 345 Future get done => _target.done;
346 } 346 }
347 class _AddStreamState<T> {final _Future addStreamFuture; 347 class _AddStreamState<T> {final _Future addStreamFuture;
348 final StreamSubscription addSubscription; 348 final StreamSubscription addSubscription;
349 _AddStreamState(_EventSink<T> controller, Stream source, bool cancelOnError) : addStreamFuture = new _Future(), addSubscription = source.listen(controller._add , onError: ((__x48) => DEVC$RT.cast(__x48, dynamic, Function, "DynamicCast", """ line 746, column 50 of dart:async/stream_controller.dart: """, __x48 is Function , true))(cancelOnError ? makeErrorHandler(controller) : controller._addError), o nDone: controller._close, cancelOnError: cancelOnError); 349 _AddStreamState(_EventSink<T> controller, Stream source, bool cancelOnError) : addStreamFuture = new _Future(), addSubscription = source.listen(controller._add , onError: cancelOnError ? ((__x48) => DEVC$RT.cast(__x48, dynamic, Function, "D ynamicCast", """line 747, column 48 of dart:async/stream_controller.dart: """, _ _x48 is Function, true))(makeErrorHandler(controller)) : controller._addError, o nDone: controller._close, cancelOnError: cancelOnError);
350 static makeErrorHandler(_EventSink controller) => (e, StackTrace s) { 350 static makeErrorHandler(_EventSink controller) => (e, StackTrace s) {
351 controller._addError(e, s); 351 controller._addError(e, s);
352 controller._close(); 352 controller._close();
353 } 353 }
354 ; 354 ;
355 void pause() { 355 void pause() {
356 addSubscription.pause(); 356 addSubscription.pause();
357 } 357 }
358 void resume() { 358 void resume() {
359 addSubscription.resume(); 359 addSubscription.resume();
(...skipping 17 matching lines...) Expand all
377 _StreamControllerAddStreamState(_StreamController controller, this.varData, Str eam source, bool cancelOnError) : super(DEVC$RT.cast(controller, DEVC$RT.type((_ StreamController<dynamic> _) { 377 _StreamControllerAddStreamState(_StreamController controller, this.varData, Str eam source, bool cancelOnError) : super(DEVC$RT.cast(controller, DEVC$RT.type((_ StreamController<dynamic> _) {
378 } 378 }
379 ), DEVC$RT.type((_EventSink<T> _) { 379 ), DEVC$RT.type((_EventSink<T> _) {
380 } 380 }
381 ), "CompositeCast", """line 798, column 15 of dart:async/stream_controller.dart: """, controller is _EventSink<T>, false), source, cancelOnError) { 381 ), "CompositeCast", """line 798, column 15 of dart:async/stream_controller.dart: """, controller is _EventSink<T>, false), source, cancelOnError) {
382 if (controller.isPaused) { 382 if (controller.isPaused) {
383 addSubscription.pause(); 383 addSubscription.pause();
384 } 384 }
385 } 385 }
386 } 386 }
OLDNEW
« no previous file with comments | « test/checker/checker_test.dart ('k') | test/dart_codegen/expect/async/zone.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698