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

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

Issue 12061002: Fixing type check error using Stream.take in dart2js checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | sdk/lib/html/dart2js/html_dart2js.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** Utility function to create an [AsyncError] if [error] isn't one already. */ 7 /** Utility function to create an [AsyncError] if [error] isn't one already. */
8 AsyncError _asyncError(Object error, Object stackTrace, [AsyncError cause]) { 8 AsyncError _asyncError(Object error, Object stackTrace, [AsyncError cause]) {
9 if (error is AsyncError) return error; 9 if (error is AsyncError) return error;
10 if (cause == null) return new AsyncError(error, stackTrace); 10 if (cause == null) return new AsyncError(error, stackTrace);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // If the transformation sends a done signal, we stop the subscription. 164 // If the transformation sends a done signal, we stop the subscription.
165 if (_subscription != null) { 165 if (_subscription != null) {
166 _subscription.cancel(); 166 _subscription.cancel();
167 _subscription = null; 167 _subscription = null;
168 } 168 }
169 _onDone(); 169 _onDone();
170 } 170 }
171 171
172 // Methods used as listener on source subscription. 172 // Methods used as listener on source subscription.
173 173
174 void _handleData(S data) { 174 // TODO(ahe): Restore type when feature is implemented in dart2js
175 // checked mode. http://dartbug.com/7733
176 void _handleData(/*S*/ data) {
175 _stream._handleData(data, this); 177 _stream._handleData(data, this);
176 } 178 }
177 179
178 void _handleError(AsyncError error) { 180 void _handleError(AsyncError error) {
179 _stream._handleError(error, this); 181 _stream._handleError(error, this);
180 } 182 }
181 183
182 void _handleDone() { 184 void _handleDone() {
183 _stream._handleDone(this); 185 _stream._handleDone(this);
184 } 186 }
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 /** Creates a [StreamSink] from a [_StreamImpl]'s input methods. */ 504 /** Creates a [StreamSink] from a [_StreamImpl]'s input methods. */
503 class _StreamImplSink<T> implements StreamSink<T> { 505 class _StreamImplSink<T> implements StreamSink<T> {
504 _StreamImpl<T> _target; 506 _StreamImpl<T> _target;
505 _StreamImplSink(this._target); 507 _StreamImplSink(this._target);
506 void add(T data) { _target._add(data); } 508 void add(T data) { _target._add(data); }
507 void signalError(AsyncError error) { _target._signalError(error); } 509 void signalError(AsyncError error) { _target._signalError(error); }
508 void close() { _target._close(); } 510 void close() { _target._close(); }
509 } 511 }
510 512
511 513
OLDNEW
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698