OLD | NEW |
1 dart_library.library('dart/convert', null, /* Imports */[ | 1 dart_library.library('dart/convert', null, /* Imports */[ |
2 'dart/_runtime', | 2 'dart/_runtime', |
3 'dart/core', | 3 'dart/core', |
4 'dart/async', | 4 'dart/async', |
5 'dart/typed_data', | 5 'dart/typed_data', |
6 'dart/_internal', | 6 'dart/_internal', |
7 'dart/collection' | 7 'dart/collection' |
8 ], /* Lazy imports */[ | 8 ], /* Lazy imports */[ |
9 ], function(exports, dart, core, async, typed_data, _internal, collection) { | 9 ], function(exports, dart, core, async, typed_data, _internal, collection) { |
10 'use strict'; | 10 'use strict'; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 name = name[dartx.toLowerCase](); | 55 name = name[dartx.toLowerCase](); |
56 return Encoding._nameToEncoding.get(name); | 56 return Encoding._nameToEncoding.get(name); |
57 } | 57 } |
58 } | 58 } |
59 dart.setSignature(Encoding, { | 59 dart.setSignature(Encoding, { |
60 constructors: () => ({Encoding: [Encoding, []]}), | 60 constructors: () => ({Encoding: [Encoding, []]}), |
61 methods: () => ({decodeStream: [async.Future$(core.String), [async.Stream$(c
ore.List$(core.int))]]}), | 61 methods: () => ({decodeStream: [async.Future$(core.String), [async.Stream$(c
ore.List$(core.int))]]}), |
62 statics: () => ({getByName: [Encoding, [core.String]]}), | 62 statics: () => ({getByName: [Encoding, [core.String]]}), |
63 names: ['getByName'] | 63 names: ['getByName'] |
64 }); | 64 }); |
| 65 dart.defineLazyProperties(Encoding, { |
| 66 get _nameToEncoding() { |
| 67 return dart.map({"iso_8859-1:1987": LATIN1, "iso-ir-100": LATIN1, "iso_885
9-1": LATIN1, "iso-8859-1": LATIN1, latin1: LATIN1, l1: LATIN1, ibm819: LATIN1,
cp819: LATIN1, csisolatin1: LATIN1, "iso-ir-6": ASCII, "ansi_x3.4-1968": ASCII,
"ansi_x3.4-1986": ASCII, "iso_646.irv:1991": ASCII, "iso646-us": ASCII, "us-asci
i": ASCII, us: ASCII, ibm367: ASCII, cp367: ASCII, csascii: ASCII, ascii: ASCII,
csutf8: UTF8, "utf-8": UTF8}); |
| 68 }, |
| 69 set _nameToEncoding(_) {} |
| 70 }); |
65 const _allowInvalid = Symbol('_allowInvalid'); | 71 const _allowInvalid = Symbol('_allowInvalid'); |
66 class AsciiCodec extends Encoding { | 72 class AsciiCodec extends Encoding { |
67 AsciiCodec(opts) { | 73 AsciiCodec(opts) { |
68 let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : fa
lse; | 74 let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : fa
lse; |
69 this[_allowInvalid] = allowInvalid; | 75 this[_allowInvalid] = allowInvalid; |
70 super.Encoding(); | 76 super.Encoding(); |
71 } | 77 } |
72 get name() { | 78 get name() { |
73 return "us-ascii"; | 79 return "us-ascii"; |
74 } | 80 } |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 dart.setSignature(_FusedConverter, { | 628 dart.setSignature(_FusedConverter, { |
623 constructors: () => ({_FusedConverter: [_FusedConverter$(S, M, T), [Conver
ter, Converter]]}), | 629 constructors: () => ({_FusedConverter: [_FusedConverter$(S, M, T), [Conver
ter, Converter]]}), |
624 methods: () => ({ | 630 methods: () => ({ |
625 convert: [T, [S]], | 631 convert: [T, [S]], |
626 startChunkedConversion: [ChunkedConversionSink, [core.Sink$(T)]] | 632 startChunkedConversion: [ChunkedConversionSink, [core.Sink$(T)]] |
627 }) | 633 }) |
628 }); | 634 }); |
629 return _FusedConverter; | 635 return _FusedConverter; |
630 }); | 636 }); |
631 let _FusedConverter = _FusedConverter$(); | 637 let _FusedConverter = _FusedConverter$(); |
632 dart.defineLazyProperties(Encoding, { | |
633 get _nameToEncoding() { | |
634 return dart.map({"iso_8859-1:1987": LATIN1, "iso-ir-100": LATIN1, "iso_885
9-1": LATIN1, "iso-8859-1": LATIN1, latin1: LATIN1, l1: LATIN1, ibm819: LATIN1,
cp819: LATIN1, csisolatin1: LATIN1, "iso-ir-6": ASCII, "ansi_x3.4-1968": ASCII,
"ansi_x3.4-1986": ASCII, "iso_646.irv:1991": ASCII, "iso646-us": ASCII, "us-asci
i": ASCII, us: ASCII, ibm367: ASCII, cp367: ASCII, csascii: ASCII, ascii: ASCII,
csutf8: UTF8, "utf-8": UTF8}); | |
635 }, | |
636 set _nameToEncoding(_) {} | |
637 }); | |
638 const _name = Symbol('_name'); | 638 const _name = Symbol('_name'); |
639 class HtmlEscapeMode extends core.Object { | 639 class HtmlEscapeMode extends core.Object { |
640 _(name, escapeLtGt, escapeQuot, escapeApos, escapeSlash) { | 640 _(name, escapeLtGt, escapeQuot, escapeApos, escapeSlash) { |
641 this[_name] = name; | 641 this[_name] = name; |
642 this.escapeLtGt = escapeLtGt; | 642 this.escapeLtGt = escapeLtGt; |
643 this.escapeQuot = escapeQuot; | 643 this.escapeQuot = escapeQuot; |
644 this.escapeApos = escapeApos; | 644 this.escapeApos = escapeApos; |
645 this.escapeSlash = escapeSlash; | 645 this.escapeSlash = escapeSlash; |
646 } | 646 } |
647 toString() { | 647 toString() { |
648 return this[_name]; | 648 return this[_name]; |
649 } | 649 } |
650 } | 650 } |
651 dart.defineNamedConstructor(HtmlEscapeMode, '_'); | 651 dart.defineNamedConstructor(HtmlEscapeMode, '_'); |
652 dart.setSignature(HtmlEscapeMode, { | 652 dart.setSignature(HtmlEscapeMode, { |
653 constructors: () => ({_: [HtmlEscapeMode, [core.String, core.bool, core.bool
, core.bool, core.bool]]}) | 653 constructors: () => ({_: [HtmlEscapeMode, [core.String, core.bool, core.bool
, core.bool, core.bool]]}) |
654 }); | 654 }); |
655 HtmlEscapeMode.UNKNOWN = dart.const(new HtmlEscapeMode._('unknown', true, true
, true, true)); | 655 dart.defineLazyProperties(HtmlEscapeMode, { |
| 656 get UNKNOWN() { |
| 657 return dart.const(new HtmlEscapeMode._('unknown', true, true, true, true))
; |
| 658 }, |
| 659 get ATTRIBUTE() { |
| 660 return dart.const(new HtmlEscapeMode._('attribute', false, true, false, fa
lse)); |
| 661 }, |
| 662 get ELEMENT() { |
| 663 return dart.const(new HtmlEscapeMode._('element', true, false, false, true
)); |
| 664 } |
| 665 }); |
656 const _convert = Symbol('_convert'); | 666 const _convert = Symbol('_convert'); |
657 class HtmlEscape extends Converter$(core.String, core.String) { | 667 class HtmlEscape extends Converter$(core.String, core.String) { |
658 HtmlEscape(mode) { | 668 HtmlEscape(mode) { |
659 if (mode === void 0) mode = HtmlEscapeMode.UNKNOWN; | 669 if (mode === void 0) mode = HtmlEscapeMode.UNKNOWN; |
660 this.mode = mode; | 670 this.mode = mode; |
661 super.Converter(); | 671 super.Converter(); |
662 } | 672 } |
663 convert(text) { | 673 convert(text) { |
664 let val = this[_convert](text, 0, text[dartx.length]); | 674 let val = this[_convert](text, 0, text[dartx.length]); |
665 return val == null ? text : val; | 675 return val == null ? text : val; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 } | 734 } |
725 dart.setSignature(HtmlEscape, { | 735 dart.setSignature(HtmlEscape, { |
726 constructors: () => ({HtmlEscape: [HtmlEscape, [], [HtmlEscapeMode]]}), | 736 constructors: () => ({HtmlEscape: [HtmlEscape, [], [HtmlEscapeMode]]}), |
727 methods: () => ({ | 737 methods: () => ({ |
728 convert: [core.String, [core.String]], | 738 convert: [core.String, [core.String]], |
729 [_convert]: [core.String, [core.String, core.int, core.int]], | 739 [_convert]: [core.String, [core.String, core.int, core.int]], |
730 startChunkedConversion: [StringConversionSink, [core.Sink$(core.String)]] | 740 startChunkedConversion: [StringConversionSink, [core.Sink$(core.String)]] |
731 }) | 741 }) |
732 }); | 742 }); |
733 const HTML_ESCAPE = dart.const(new HtmlEscape()); | 743 const HTML_ESCAPE = dart.const(new HtmlEscape()); |
734 HtmlEscapeMode.ATTRIBUTE = dart.const(new HtmlEscapeMode._('attribute', false,
true, false, false)); | |
735 HtmlEscapeMode.ELEMENT = dart.const(new HtmlEscapeMode._('element', true, fals
e, false, true)); | |
736 const _escape = Symbol('_escape'); | 744 const _escape = Symbol('_escape'); |
737 class _HtmlEscapeSink extends StringConversionSinkBase { | 745 class _HtmlEscapeSink extends StringConversionSinkBase { |
738 _HtmlEscapeSink(escape, sink) { | 746 _HtmlEscapeSink(escape, sink) { |
739 this[_escape] = escape; | 747 this[_escape] = escape; |
740 this[_sink] = sink; | 748 this[_sink] = sink; |
741 } | 749 } |
742 addSlice(chunk, start, end, isLast) { | 750 addSlice(chunk, start, end, isLast) { |
743 let val = this[_escape][_convert](chunk, start, end); | 751 let val = this[_escape][_convert](chunk, start, end); |
744 if (val == null) { | 752 if (val == null) { |
745 this[_sink].addSlice(chunk, start, end, isLast); | 753 this[_sink].addSlice(chunk, start, end, isLast); |
(...skipping 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2804 exports.LineSplitter = LineSplitter; | 2812 exports.LineSplitter = LineSplitter; |
2805 exports.StringConversionSink = StringConversionSink; | 2813 exports.StringConversionSink = StringConversionSink; |
2806 exports.ClosableStringSink = ClosableStringSink; | 2814 exports.ClosableStringSink = ClosableStringSink; |
2807 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN
E; | 2815 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN
E; |
2808 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE; | 2816 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE; |
2809 exports.Utf8Codec = Utf8Codec; | 2817 exports.Utf8Codec = Utf8Codec; |
2810 exports.UTF8 = UTF8; | 2818 exports.UTF8 = UTF8; |
2811 exports.Utf8Encoder = Utf8Encoder; | 2819 exports.Utf8Encoder = Utf8Encoder; |
2812 exports.Utf8Decoder = Utf8Decoder; | 2820 exports.Utf8Decoder = Utf8Decoder; |
2813 }); | 2821 }); |
OLD | NEW |