OLD | NEW |
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 Loading... |
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(((__x27) => DEVC$RT.cast(__x27, DEVC$RT.type((List<dynamic> _)
{ |
76 } | 76 } |
77 ), DEVC$RT.type((List<int> _) { | 77 ), DEVC$RT.type((List<int> _) { |
78 } | 78 } |
79 ), "CastLiteral", """line 161, column 25 of dart:convert/latin1.dart: """, __x27
is List<int>, false))(const [0xFFFD]), 0, 1, false); | 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; | 80 start = i + 1; |
81 } | 81 } |
82 } | 82 } |
83 if (start < end) { | 83 if (start < end) { |
84 _addSliceToSink(source, start, end, isLast); | 84 _addSliceToSink(source, start, end, isLast); |
85 } | 85 } |
86 if (isLast) { | 86 if (isLast) { |
87 close(); | 87 close(); |
88 } | 88 } |
89 } | 89 } |
90 } | 90 } |
OLD | NEW |