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

Side by Side Diff: lib/src/lazy_stream.dart

Issue 2660333005: Change generic comment syntax to real generic syntax. (Closed)
Patch Set: Update version. Created 3 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 unified diff | Download patch
« no previous file with comments | « lib/src/future_group.dart ('k') | lib/src/result.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 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import "dart:async"; 5 import "dart:async";
6 6
7 import "stream_completer.dart"; 7 import "stream_completer.dart";
8 import "delegate/stream.dart"; 8 import "delegate/stream.dart";
9 9
10 /// A [Stream] wrapper that forwards to another [Stream] that's initialized 10 /// A [Stream] wrapper that forwards to another [Stream] that's initialized
(...skipping 25 matching lines...) Expand all
36 36
37 // Null out the callback before we invoke it to ensure that even while 37 // Null out the callback before we invoke it to ensure that even while
38 // running it, this can't be called twice. 38 // running it, this can't be called twice.
39 var callback = _callback; 39 var callback = _callback;
40 _callback = null; 40 _callback = null;
41 var result = callback(); 41 var result = callback();
42 42
43 Stream<T> stream; 43 Stream<T> stream;
44 if (result is Future) { 44 if (result is Future) {
45 stream = StreamCompleter.fromFuture(result.then((stream) { 45 stream = StreamCompleter.fromFuture(result.then((stream) {
46 return DelegatingStream.typed/*<T>*/(stream as Stream); 46 return DelegatingStream.typed<T>(stream as Stream);
47 })); 47 }));
48 } else { 48 } else {
49 stream = DelegatingStream.typed/*<T>*/(result as Stream); 49 stream = DelegatingStream.typed<T>(result as Stream);
50 } 50 }
51 51
52 return stream.listen(onData, 52 return stream.listen(onData,
53 onError: onError, onDone: onDone, cancelOnError: cancelOnError); 53 onError: onError, onDone: onDone, cancelOnError: cancelOnError);
54 } 54 }
55 } 55 }
OLDNEW
« no previous file with comments | « lib/src/future_group.dart ('k') | lib/src/result.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698