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

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

Issue 959003003: Typecheck constructor initializers properly (Closed) Base URL: https://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 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 class _Latin1AllowInvalidDecoderSink extends _Latin1DecoderSink {_Latin1AllowIn validDecoderSink(StringConversionSink sink) : super(sink); 70 class _Latin1AllowInvalidDecoderSink extends _Latin1DecoderSink {_Latin1AllowIn validDecoderSink(StringConversionSink sink) : super(sink);
71 void addSlice(List<int> source, int start, int end, bool isLast) { 71 void addSlice(List<int> source, int start, int end, bool isLast) {
72 RangeError.checkValidRange(start, end, source.length); 72 RangeError.checkValidRange(start, end, source.length);
73 for (int i = start; 73 for (int i = start;
74 i < end; 74 i < end;
75 i++) { 75 i++) {
76 int char = source[i]; 76 int char = source[i];
77 if (char > _LATIN1_MASK || char < 0) { 77 if (char > _LATIN1_MASK || char < 0) {
78 if (i > start) _addSliceToSink(source, start, i, false); 78 if (i > start) _addSliceToSink(source, start, i, false);
79 _addSliceToSink(((__x26) => DDC$RT.cast(__x26, DDC$RT.type((List<dynamic> _) { 79 _addSliceToSink(((__x27) => DDC$RT.cast(__x27, DDC$RT.type((List<dynamic> _) {
80 } 80 }
81 ), DDC$RT.type((List<int> _) { 81 ), DDC$RT.type((List<int> _) {
82 } 82 }
83 ), "CastLiteral", """line 161, column 25 of dart:convert/latin1.dart: """, __x26 is List<int>, false))(const [0xFFFD]), 0, 1, false); 83 ), "CastLiteral", """line 161, column 25 of dart:convert/latin1.dart: """, __x27 is List<int>, false))(const [0xFFFD]), 0, 1, false);
84 start = i + 1; 84 start = i + 1;
85 } 85 }
86 } 86 }
87 if (start < end) { 87 if (start < end) {
88 _addSliceToSink(source, start, end, isLast); 88 _addSliceToSink(source, start, end, isLast);
89 } 89 }
90 if (isLast) { 90 if (isLast) {
91 close(); 91 close();
92 } 92 }
93 } 93 }
94 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698