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

Side by Side Diff: test/dart_codegen/expect/convert/utf.dart

Issue 1023543002: Enable inference in the core libs (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 part of dart.convert; 1 part of dart.convert;
2 const int UNICODE_REPLACEMENT_CHARACTER_RUNE = 0xFFFD; 2 const int UNICODE_REPLACEMENT_CHARACTER_RUNE = 0xFFFD;
3 const int UNICODE_BOM_CHARACTER_RUNE = 0xFEFF; 3 const int UNICODE_BOM_CHARACTER_RUNE = 0xFEFF;
4 const Utf8Codec UTF8 = const Utf8Codec(); 4 const Utf8Codec UTF8 = const Utf8Codec();
5 class Utf8Codec extends Encoding {final bool _allowMalformed; 5 class Utf8Codec extends Encoding {final bool _allowMalformed;
6 const Utf8Codec({ 6 const Utf8Codec({
7 bool allowMalformed : false} 7 bool allowMalformed : false}
8 ) : _allowMalformed = allowMalformed; 8 ) : _allowMalformed = allowMalformed;
9 String get name => "utf-8"; 9 String get name => "utf-8";
10 String decode(List<int> codeUnits, { 10 String decode(List<int> codeUnits, {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 Stream<List<int>> bind(Stream<String> stream) => ((__x32) => DEVC$RT.cast(__x32 , DEVC$RT.type((DDC$async$.Stream<dynamic> _) { 44 Stream<List<int>> bind(Stream<String> stream) => ((__x32) => DEVC$RT.cast(__x32 , DEVC$RT.type((DDC$async$.Stream<dynamic> _) {
45 } 45 }
46 ), DEVC$RT.type((DDC$async$.Stream<List<int>> _) { 46 ), DEVC$RT.type((DDC$async$.Stream<List<int>> _) {
47 } 47 }
48 ), "CastDynamic", """line 129, column 52 of dart:convert/utf.dart: """, __x32 is DDC$async$.Stream<List<int>>, false))(super.bind(stream)); 48 ), "CastDynamic", """line 129, column 52 of dart:convert/utf.dart: """, __x32 is DDC$async$.Stream<List<int>>, false))(super.bind(stream));
49 } 49 }
50 class _Utf8Encoder {int _carry = 0; 50 class _Utf8Encoder {int _carry = 0;
51 int _bufferIndex = 0; 51 int _bufferIndex = 0;
52 final List<int> _buffer; 52 final List<int> _buffer;
53 static const _DEFAULT_BYTE_BUFFER_SIZE = 1024; 53 static const _DEFAULT_BYTE_BUFFER_SIZE = 1024;
54 _Utf8Encoder() : this.withBufferSize(DEVC$RT.cast(_DEFAULT_BYTE_BUFFER_SIZE, dy namic, int, "CastGeneral", """line 143, column 40 of dart:convert/utf.dart: """, _DEFAULT_BYTE_BUFFER_SIZE is int, true)); 54 _Utf8Encoder() : this.withBufferSize(_DEFAULT_BYTE_BUFFER_SIZE);
55 _Utf8Encoder.withBufferSize(int bufferSize) : _buffer = _createBuffer(bufferSiz e); 55 _Utf8Encoder.withBufferSize(int bufferSize) : _buffer = _createBuffer(bufferSiz e);
56 static List<int> _createBuffer(int size) => new Uint8List(size); 56 static List<int> _createBuffer(int size) => new Uint8List(size);
57 bool _writeSurrogate(int leadingSurrogate, int nextCodeUnit) { 57 bool _writeSurrogate(int leadingSurrogate, int nextCodeUnit) {
58 if (_isTailSurrogate(nextCodeUnit)) { 58 if (_isTailSurrogate(nextCodeUnit)) {
59 int rune = _combineSurrogatePair(leadingSurrogate, nextCodeUnit); 59 int rune = _combineSurrogatePair(leadingSurrogate, nextCodeUnit);
60 assert (rune > _THREE_BYTE_LIMIT); assert (rune <= _FOUR_BYTE_LIMIT); _buffer[_ bufferIndex++] = 0xF0 | (rune >> 18); 60 assert (rune > _THREE_BYTE_LIMIT); assert (rune <= _FOUR_BYTE_LIMIT); _buffer[_ bufferIndex++] = 0xF0 | (rune >> 18);
61 _buffer[_bufferIndex++] = 0x80 | ((rune >> 12) & 0x3f); 61 _buffer[_bufferIndex++] = 0x80 | ((rune >> 12) & 0x3f);
62 _buffer[_bufferIndex++] = 0x80 | ((rune >> 6) & 0x3f); 62 _buffer[_bufferIndex++] = 0x80 | ((rune >> 6) & 0x3f);
63 _buffer[_bufferIndex++] = 0x80 | (rune & 0x3f); 63 _buffer[_bufferIndex++] = 0x80 | (rune & 0x3f);
64 return true; 64 return true;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 } 315 }
316 break loop; 316 break loop;
317 } 317 }
318 if (expectedUnits > 0) { 318 if (expectedUnits > 0) {
319 _value = value; 319 _value = value;
320 _expectedUnits = expectedUnits; 320 _expectedUnits = expectedUnits;
321 _extraUnits = extraUnits; 321 _extraUnits = extraUnits;
322 } 322 }
323 } 323 }
324 } 324 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/convert/byte_conversion.dart ('k') | test/dart_codegen/expect/core/uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698