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

Side by Side Diff: sdk/lib/convert/converter.dart

Issue 2035473003: Avoid runtime type errors in checked mode for ChunkedConverters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | « sdk/lib/convert/base64.dart ('k') | sdk/lib/convert/html_escape.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) 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.convert; 5 part of dart.convert;
6 6
7 /** 7 /**
8 * A [Converter] converts data from one representation into another. 8 * A [Converter] converts data from one representation into another.
9 * 9 *
10 * It is recommended that implementations of `Converter` extend this class, 10 * It is recommended that implementations of `Converter` extend this class,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 stream, 45 stream,
46 (EventSink sink) => new _ConverterStreamEventSink(this, sink)); 46 (EventSink sink) => new _ConverterStreamEventSink(this, sink));
47 } 47 }
48 } 48 }
49 49
50 /** 50 /**
51 * Fuses two converters. 51 * Fuses two converters.
52 * 52 *
53 * For a non-chunked conversion converts the input in sequence. 53 * For a non-chunked conversion converts the input in sequence.
54 */ 54 */
55 class _FusedConverter<S, M, T> extends Converter<S, T> { 55 class _FusedConverter<S, M, T> extends Converter<S, T>
56 implements ChunkedConverter<S, T, S, T> {
56 final Converter<S, M> _first; 57 final Converter<S, M> _first;
57 final Converter<M, T> _second; 58 final Converter<M, T> _second;
58 59
59 _FusedConverter(this._first, this._second); 60 _FusedConverter(this._first, this._second);
60 61
61 T convert(S input) => _second.convert(_first.convert(input)); 62 T convert(S input) => _second.convert(_first.convert(input));
62 63
63 Sink/*<S>*/ startChunkedConversion(Sink/*<T>*/ sink) { 64 Sink/*<S>*/ startChunkedConversion(Sink/*<T>*/ sink) {
64 return _first.startChunkedConversion(_second.startChunkedConversion(sink)); 65 return _first.startChunkedConversion(_second.startChunkedConversion(sink));
65 } 66 }
66 } 67 }
OLDNEW
« no previous file with comments | « sdk/lib/convert/base64.dart ('k') | sdk/lib/convert/html_escape.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698