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

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

Issue 959003003: Typecheck constructor initializers properly (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase 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 HtmlEscape HTML_ESCAPE = const HtmlEscape(); 2 const HtmlEscape HTML_ESCAPE = const HtmlEscape();
3 class HtmlEscapeMode {final String _name; 3 class HtmlEscapeMode {final String _name;
4 final bool escapeLtGt; 4 final bool escapeLtGt;
5 final bool escapeQuot; 5 final bool escapeQuot;
6 final bool escapeApos; 6 final bool escapeApos;
7 final bool escapeSlash; 7 final bool escapeSlash;
8 static const HtmlEscapeMode UNKNOWN = const HtmlEscapeMode._('unknown', true, t rue, true, true); 8 static const HtmlEscapeMode UNKNOWN = const HtmlEscapeMode._('unknown', true, t rue, true, true);
9 static const HtmlEscapeMode ATTRIBUTE = const HtmlEscapeMode._('attribute', fal se, true, false, false); 9 static const HtmlEscapeMode ATTRIBUTE = const HtmlEscapeMode._('attribute', fal se, true, false, false);
10 static const HtmlEscapeMode ELEMENT = const HtmlEscapeMode._('element', true, f alse, false, true); 10 static const HtmlEscapeMode ELEMENT = const HtmlEscapeMode._('element', true, f alse, false, true);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 else if (result != null) { 44 else if (result != null) {
45 result.write(ch); 45 result.write(ch);
46 } 46 }
47 } 47 }
48 return ((__x6) => DDC$RT.cast(__x6, dynamic, String, "CastGeneral", """line 72, column 12 of dart:convert/html_escape.dart: """, __x6 is String, true))(result != null ? result.toString() : null); 48 return ((__x6) => DDC$RT.cast(__x6, dynamic, String, "CastGeneral", """line 72, column 12 of dart:convert/html_escape.dart: """, __x6 is String, true))(result != null ? result.toString() : null);
49 } 49 }
50 StringConversionSink startChunkedConversion(Sink<String> sink) { 50 StringConversionSink startChunkedConversion(Sink<String> sink) {
51 if (sink is! StringConversionSink) { 51 if (sink is! StringConversionSink) {
52 sink = new StringConversionSink.from(sink); 52 sink = new StringConversionSink.from(sink);
53 } 53 }
54 return new _HtmlEscapeSink(this, sink); 54 return new _HtmlEscapeSink(this, DDC$RT.cast(sink, DDC$RT.type((Sink<String> _) {
55 }
56 ), StringConversionSink, "CastGeneral", """line 79, column 38 of dart:convert/ht ml_escape.dart: """, sink is StringConversionSink, true));
55 } 57 }
56 } 58 }
57 class _HtmlEscapeSink extends StringConversionSinkBase {final HtmlEscape _escap e; 59 class _HtmlEscapeSink extends StringConversionSinkBase {final HtmlEscape _escap e;
58 final StringConversionSink _sink; 60 final StringConversionSink _sink;
59 _HtmlEscapeSink(this._escape, this._sink); 61 _HtmlEscapeSink(this._escape, this._sink);
60 void addSlice(String chunk, int start, int end, bool isLast) { 62 void addSlice(String chunk, int start, int end, bool isLast) {
61 var val = _escape._convert(chunk, start, end); 63 var val = _escape._convert(chunk, start, end);
62 if (val == null) { 64 if (val == null) {
63 _sink.addSlice(chunk, start, end, isLast); 65 _sink.addSlice(chunk, start, end, isLast);
64 } 66 }
65 else { 67 else {
66 _sink.add(val); 68 _sink.add(val);
67 if (isLast) _sink.close(); 69 if (isLast) _sink.close();
68 } 70 }
69 } 71 }
70 void close() => _sink.close(); 72 void close() => _sink.close();
71 } 73 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/convert/byte_conversion.dart ('k') | test/dart_codegen/expect/convert/json.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698