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

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

Issue 1038213003: Downward inference (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Implement named arguments, some fixes Created 5 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
OLDNEW
1 part of dart.convert; 1 part of dart.convert;
2 const Latin1Codec LATIN1 = const Latin1Codec(); 2 const Latin1Codec LATIN1 = const Latin1Codec();
3 const int _LATIN1_MASK = 0xFF; 3 const int _LATIN1_MASK = 0xFF;
4 class Latin1Codec extends Encoding {final bool _allowInvalid; 4 class Latin1Codec extends Encoding {final bool _allowInvalid;
5 const Latin1Codec({ 5 const Latin1Codec({
6 bool allowInvalid : false} 6 bool allowInvalid : false}
7 ) : _allowInvalid = allowInvalid; 7 ) : _allowInvalid = allowInvalid;
8 String get name => "iso-8859-1"; 8 String get name => "iso-8859-1";
9 String decode(List<int> bytes, { 9 String decode(List<int> bytes, {
10 bool allowInvalid} 10 bool allowInvalid}
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 } 66 }
67 } 67 }
68 class _Latin1AllowInvalidDecoderSink extends _Latin1DecoderSink {_Latin1AllowIn validDecoderSink(StringConversionSink sink) : super(sink); 68 class _Latin1AllowInvalidDecoderSink extends _Latin1DecoderSink {_Latin1AllowIn validDecoderSink(StringConversionSink sink) : super(sink);
69 void addSlice(List<int> source, int start, int end, bool isLast) { 69 void addSlice(List<int> source, int start, int end, bool isLast) {
70 RangeError.checkValidRange(start, end, source.length); 70 RangeError.checkValidRange(start, end, source.length);
71 for (int i = start; i < end; i++) { 71 for (int i = start; i < end; i++) {
72 int char = source[i]; 72 int char = source[i];
73 if (char > _LATIN1_MASK || char < 0) { 73 if (char > _LATIN1_MASK || char < 0) {
74 if (i > start) _addSliceToSink(source, start, i, false); 74 if (i > start) _addSliceToSink(source, start, i, false);
75 _addSliceToSink(((__x27) => DEVC$RT.cast(__x27, DEVC$RT.type((List<dynamic> _) { 75 _addSliceToSink(const <int> [0xFFFD], 0, 1, false);
76 }
77 ), DEVC$RT.type((List<int> _) {
78 }
79 ), "InferableLiteral", """line 161, column 25 of dart:convert/latin1.dart: """, __x27 is List<int>, false))(const [0xFFFD]), 0, 1, false);
80 start = i + 1; 76 start = i + 1;
81 } 77 }
82 } 78 }
83 if (start < end) { 79 if (start < end) {
84 _addSliceToSink(source, start, end, isLast); 80 _addSliceToSink(source, start, end, isLast);
85 } 81 }
86 if (isLast) { 82 if (isLast) {
87 close(); 83 close();
88 } 84 }
89 } 85 }
90 } 86 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/convert/json.dart ('k') | test/dart_codegen/expect/convert/string_conversion.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698