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

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

Issue 2529393002: Make core libraries use generic method syntax. (Closed)
Patch Set: Merge to head Created 4 years 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
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 /** The Unicode Replacement character `U+FFFD` (�). */ 7 /** The Unicode Replacement character `U+FFFD` (�). */
8 const int UNICODE_REPLACEMENT_CHARACTER_RUNE = 0xFFFD; 8 const int UNICODE_REPLACEMENT_CHARACTER_RUNE = 0xFFFD;
9 9
10 /** The Unicode Byte Order Marker (BOM) character `U+FEFF`. */ 10 /** The Unicode Byte Order Marker (BOM) character `U+FEFF`. */
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 stringSink = sink; 363 stringSink = sink;
364 } else { 364 } else {
365 stringSink = new StringConversionSink.from(sink); 365 stringSink = new StringConversionSink.from(sink);
366 } 366 }
367 return stringSink.asUtf8Sink(_allowMalformed); 367 return stringSink.asUtf8Sink(_allowMalformed);
368 } 368 }
369 369
370 // Override the base-classes bind, to provide a better type. 370 // Override the base-classes bind, to provide a better type.
371 Stream<String> bind(Stream<List<int>> stream) => super.bind(stream); 371 Stream<String> bind(Stream<List<int>> stream) => super.bind(stream);
372 372
373 external Converter<List<int>, dynamic/*=T*/> fuse/*<T>*/( 373 external Converter<List<int>, T> fuse<T>(
374 Converter<String, dynamic/*=T*/> next); 374 Converter<String, T> next);
floitsch 2016/12/13 12:42:25 Does this fit on one line?
Lasse Reichstein Nielsen 2016/12/13 14:28:03 Done.
375 375
376 external static String _convertIntercepted( 376 external static String _convertIntercepted(
377 bool allowMalformed, List<int> codeUnits, int start, int end); 377 bool allowMalformed, List<int> codeUnits, int start, int end);
378 } 378 }
379 379
380 // UTF-8 constants. 380 // UTF-8 constants.
381 const int _ONE_BYTE_LIMIT = 0x7f; // 7 bits 381 const int _ONE_BYTE_LIMIT = 0x7f; // 7 bits
382 const int _TWO_BYTE_LIMIT = 0x7ff; // 11 bits 382 const int _TWO_BYTE_LIMIT = 0x7ff; // 11 bits
383 const int _THREE_BYTE_LIMIT = 0xffff; // 16 bits 383 const int _THREE_BYTE_LIMIT = 0xffff; // 16 bits
384 const int _FOUR_BYTE_LIMIT = 0x10ffff; // 21 bits, truncated to Unicode max. 384 const int _FOUR_BYTE_LIMIT = 0x10ffff; // 21 bits, truncated to Unicode max.
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 } 566 }
567 break loop; 567 break loop;
568 } 568 }
569 if (expectedUnits > 0) { 569 if (expectedUnits > 0) {
570 _value = value; 570 _value = value;
571 _expectedUnits = expectedUnits; 571 _expectedUnits = expectedUnits;
572 _extraUnits = extraUnits; 572 _extraUnits = extraUnits;
573 } 573 }
574 } 574 }
575 } 575 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698