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

Side by Side Diff: sdk/lib/io/string_transformer.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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/io/stdio.dart ('k') | sdk/lib/io/websocket_impl.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.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * String encodings. 8 * String encodings.
9 */ 9 */
10 class Encoding { 10 class Encoding {
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
309 int _decodeByte(int byte) => ((byte & 0xFF) == byte) ? byte : -1; 309 int _decodeByte(int byte) => ((byte & 0xFF) == byte) ? byte : -1;
310 } 310 }
311 311
312 312
313 abstract class _SingleByteEncoder 313 abstract class _SingleByteEncoder
314 extends StreamEventTransformer<String, List<int>> { 314 extends StreamEventTransformer<String, List<int>> {
315 void handleData(String data, EventSink<List<int>> sink) { 315 void handleData(String data, EventSink<List<int>> sink) {
316 var bytes = _encode(data); 316 var bytes = _encode(data);
317 if (bytes == null) { 317 if (bytes == null) {
318 sink.addError( 318 sink.addError(new FormatException("Invalid character for encoding"));
319 new AsyncError(
320 new FormatException("Invalid character for encoding")));
321 sink.close(); 319 sink.close();
322 } else { 320 } else {
323 sink.add(bytes); 321 sink.add(bytes);
324 } 322 }
325 } 323 }
326 324
327 List<int> _encode(String string); 325 List<int> _encode(String string);
328 } 326 }
329 327
330 328
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 363
366 // Utility class for decoding Windows current code page data delivered 364 // Utility class for decoding Windows current code page data delivered
367 // as a stream of bytes. 365 // as a stream of bytes.
368 class _WindowsCodePageDecoder extends StreamEventTransformer<List<int>, String> { 366 class _WindowsCodePageDecoder extends StreamEventTransformer<List<int>, String> {
369 void handleData(List<int> data, EventSink<String> sink) { 367 void handleData(List<int> data, EventSink<String> sink) {
370 sink.add(_decodeBytes(data)); 368 sink.add(_decodeBytes(data));
371 } 369 }
372 370
373 external static String _decodeBytes(List<int> bytes); 371 external static String _decodeBytes(List<int> bytes);
374 } 372 }
OLDNEW
« no previous file with comments | « sdk/lib/io/stdio.dart ('k') | sdk/lib/io/websocket_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698