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

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

Issue 1024073003: Treat Object and dynamic similarly (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
« no previous file with comments | « test/dart_codegen/expect/convert/latin1.dart ('k') | test/dart_codegen/expect/convert/utf.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 part of dart.convert; 1 part of dart.convert;
2 abstract class StringConversionSink extends ChunkedConversionSink<String> {Stri ngConversionSink(); 2 abstract class StringConversionSink extends ChunkedConversionSink<String> {Stri ngConversionSink();
3 factory StringConversionSink.withCallback(void callback(String accumulated)) = _StringCallbackSink; 3 factory StringConversionSink.withCallback(void callback(String accumulated)) = _StringCallbackSink;
4 factory StringConversionSink.from(Sink<String> sink) = _StringAdapterSink; 4 factory StringConversionSink.from(Sink<String> sink) = _StringAdapterSink;
5 factory StringConversionSink.fromStringSink(StringSink sink) = _StringSinkConve rsionSink; 5 factory StringConversionSink.fromStringSink(StringSink sink) = _StringSinkConve rsionSink;
6 void addSlice(String chunk, int start, int end, bool isLast); 6 void addSlice(String chunk, int start, int end, bool isLast);
7 ByteConversionSink asUtf8Sink(bool allowMalformed); 7 ByteConversionSink asUtf8Sink(bool allowMalformed);
8 ClosableStringSink asStringSink(); 8 ClosableStringSink asStringSink();
9 } 9 }
10 abstract class ClosableStringSink extends StringSink {factory ClosableStringSin k.fromStringSink(StringSink sink, void onClose()) = _ClosableStringSink; 10 abstract class ClosableStringSink extends StringSink {factory ClosableStringSin k.fromStringSink(StringSink sink, void onClose()) = _ClosableStringSink;
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 void writeln([Object o = ""]) { 40 void writeln([Object o = ""]) {
41 _buffer.writeln(o); 41 _buffer.writeln(o);
42 if (_buffer.length > _MIN_STRING_SIZE) _flush(); 42 if (_buffer.length > _MIN_STRING_SIZE) _flush();
43 } 43 }
44 void writeAll(Iterable objects, [String separator = ""]) { 44 void writeAll(Iterable objects, [String separator = ""]) {
45 if (_buffer.isNotEmpty) _flush(); 45 if (_buffer.isNotEmpty) _flush();
46 Iterator iterator = objects.iterator; 46 Iterator iterator = objects.iterator;
47 if (!iterator.moveNext()) return; if (separator.isEmpty) { 47 if (!iterator.moveNext()) return; if (separator.isEmpty) {
48 do { 48 do {
49 _chunkedSink.add(((__x29) => DEVC$RT.cast(__x29, dynamic, String, "CastGeneral", """line 147, column 26 of dart:convert/string_conversion.dart: """, __x29 is St ring, true))(iterator.current.toString())); 49 _chunkedSink.add(((__x28) => DEVC$RT.cast(__x28, dynamic, String, "CastGeneral", """line 147, column 26 of dart:convert/string_conversion.dart: """, __x28 is St ring, true))(iterator.current.toString()));
50 } 50 }
51 while (iterator.moveNext());} 51 while (iterator.moveNext());}
52 else { 52 else {
53 _chunkedSink.add(((__x30) => DEVC$RT.cast(__x30, dynamic, String, "CastGeneral", """line 150, column 24 of dart:convert/string_conversion.dart: """, __x30 is St ring, true))(iterator.current.toString())); 53 _chunkedSink.add(((__x29) => DEVC$RT.cast(__x29, dynamic, String, "CastGeneral", """line 150, column 24 of dart:convert/string_conversion.dart: """, __x29 is St ring, true))(iterator.current.toString()));
54 while (iterator.moveNext()) { 54 while (iterator.moveNext()) {
55 write(separator); 55 write(separator);
56 _chunkedSink.add(((__x31) => DEVC$RT.cast(__x31, dynamic, String, "CastGeneral" , """line 153, column 26 of dart:convert/string_conversion.dart: """, __x31 is S tring, true))(iterator.current.toString())); 56 _chunkedSink.add(((__x30) => DEVC$RT.cast(__x30, dynamic, String, "CastGeneral" , """line 153, column 26 of dart:convert/string_conversion.dart: """, __x30 is S tring, true))(iterator.current.toString()));
57 } 57 }
58 } 58 }
59 } 59 }
60 void _flush() { 60 void _flush() {
61 String accumulated = _buffer.toString(); 61 String accumulated = _buffer.toString();
62 _buffer.clear(); 62 _buffer.clear();
63 _chunkedSink.add(accumulated); 63 _chunkedSink.add(accumulated);
64 } 64 }
65 } 65 }
66 abstract class StringConversionSinkBase extends StringConversionSinkMixin {} 66 abstract class StringConversionSinkBase extends StringConversionSinkMixin {}
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void addSlice(List<int> chunk, int startIndex, int endIndex, bool isLast) { 160 void addSlice(List<int> chunk, int startIndex, int endIndex, bool isLast) {
161 _decoder.convert(chunk, startIndex, endIndex); 161 _decoder.convert(chunk, startIndex, endIndex);
162 if (_buffer.isNotEmpty) { 162 if (_buffer.isNotEmpty) {
163 String accumulated = _buffer.toString(); 163 String accumulated = _buffer.toString();
164 _chunkedSink.addSlice(accumulated, 0, accumulated.length, isLast); 164 _chunkedSink.addSlice(accumulated, 0, accumulated.length, isLast);
165 _buffer.clear(); 165 _buffer.clear();
166 return;} 166 return;}
167 if (isLast) close(); 167 if (isLast) close();
168 } 168 }
169 } 169 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/convert/latin1.dart ('k') | test/dart_codegen/expect/convert/utf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698