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

Side by Side Diff: test/codegen/expect/dart/convert.js

Issue 1020043002: Replace dart_core.js with actual compiled SDK (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merge 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/codegen/expect/dart/collection.js ('k') | test/codegen/expect/dart/core.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 var convert;
2 (function(exports) {
3 'use strict';
4 let ASCII = new AsciiCodec();
5 let _ASCII_MASK = 127;
6 let _allowInvalid = Symbol('_allowInvalid');
7 let Codec$ = dart.generic(function(S, T) {
8 class Codec extends core.Object {
9 Codec() {
10 }
11 encode(input) {
12 return this.encoder.convert(input);
13 }
14 decode(encoded) {
15 return this.decoder.convert(encoded);
16 }
17 fuse(other) {
18 return new _FusedCodec(this, other);
19 }
20 get inverted() {
21 return new _InvertedCodec(this);
22 }
23 }
24 return Codec;
25 });
26 let Codec = Codec$(dart.dynamic, dart.dynamic);
27 class Encoding extends Codec$(core.String, core.List$(core.int)) {
28 Encoding() {
29 super.Codec();
30 }
31 decodeStream(byteStream) {
32 return dart.as(byteStream.transform(dart.as(this.decoder, async.StreamTran sformer$(core.List$(core.int), dynamic))).fold(new core.StringBuffer(), (buffer, string) => dart.dinvoke(buffer, 'write', string), buffer).then((buffer) => dart .dinvoke(buffer, 'toString')), async.Future$(core.String));
33 }
34 static getByName(name) {
35 if (name === null)
36 return null;
37 name = name.toLowerCase();
38 return _nameToEncoding.get(name);
39 }
40 }
41 dart.defineLazyProperties(Encoding, {
42 get _nameToEncoding() {
43 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});
44 },
45 set _nameToEncoding(_) {}
46 });
47 class AsciiCodec extends Encoding {
48 AsciiCodec(opt$) {
49 let allowInvalid = opt$.allowInvalid === void 0 ? false : opt$.allowInvali d;
50 this[_allowInvalid] = allowInvalid;
51 super.Encoding();
52 }
53 get name() {
54 return "us-ascii";
55 }
56 decode(bytes, opt$) {
57 let allowInvalid = opt$.allowInvalid === void 0 ? null : opt$.allowInvalid ;
58 if (allowInvalid === null)
59 allowInvalid = this[_allowInvalid];
60 if (allowInvalid) {
61 return new AsciiDecoder({allowInvalid: true}).convert(bytes);
62 } else {
63 return new AsciiDecoder({allowInvalid: false}).convert(bytes);
64 }
65 }
66 get encoder() {
67 return new AsciiEncoder();
68 }
69 get decoder() {
70 return this[_allowInvalid] ? new AsciiDecoder({allowInvalid: true}) : new AsciiDecoder({allowInvalid: false});
71 }
72 }
73 let _subsetMask = Symbol('_subsetMask');
74 let Converter$ = dart.generic(function(S, T) {
75 class Converter extends core.Object {
76 Converter() {
77 }
78 fuse(other) {
79 return new _FusedConverter(this, other);
80 }
81 startChunkedConversion(sink) {
82 throw new core.UnsupportedError(`This converter does not support chunked conversions: ${this}`);
83 }
84 bind(source) {
85 return new async.Stream.eventTransformed(source, ((sink) => new _Convert erStreamEventSink(this, sink)).bind(this));
86 }
87 }
88 return Converter;
89 });
90 let Converter = Converter$(dart.dynamic, dart.dynamic);
91 class _UnicodeSubsetEncoder extends Converter$(core.String, core.List$(core.in t)) {
92 _UnicodeSubsetEncoder($_subsetMask) {
93 this[_subsetMask] = $_subsetMask;
94 super.Converter();
95 }
96 convert(string, start, end) {
97 if (start === void 0)
98 start = 0;
99 if (end === void 0)
100 end = null;
101 let stringLength = string.length;
102 core.RangeError.checkValidRange(start, end, stringLength);
103 if (end === null)
104 end = stringLength;
105 let length = dart.notNull(end) - dart.notNull(start);
106 let result = new typed_data.Uint8List(length);
107 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull(i ) + 1) {
108 let codeUnit = string.codeUnitAt(dart.notNull(start) + dart.notNull(i));
109 if ((dart.notNull(codeUnit) & ~dart.notNull(this[_subsetMask])) !== 0) {
110 throw new core.ArgumentError("String contains invalid characters.");
111 }
112 result.set(i, codeUnit);
113 }
114 return dart.as(result, core.List$(core.int));
115 }
116 startChunkedConversion(sink) {
117 if (!dart.is(sink, ByteConversionSink)) {
118 sink = new ByteConversionSink.from(sink);
119 }
120 return new _UnicodeSubsetEncoderSink(this[_subsetMask], dart.as(sink, Byte ConversionSink));
121 }
122 bind(stream) {
123 return dart.as(super.bind(stream), async.Stream$(core.List$(core.int)));
124 }
125 }
126 class AsciiEncoder extends _UnicodeSubsetEncoder {
127 AsciiEncoder() {
128 super._UnicodeSubsetEncoder(_ASCII_MASK);
129 }
130 }
131 let _sink = Symbol('_sink');
132 class StringConversionSinkMixin extends core.Object {
133 add(str) {
134 return this.addSlice(str, 0, str.length, false);
135 }
136 asUtf8Sink(allowMalformed) {
137 return new _Utf8ConversionSink(this, allowMalformed);
138 }
139 asStringSink() {
140 return new _StringConversionSinkAsStringSinkAdapter(this);
141 }
142 }
143 class StringConversionSinkBase extends StringConversionSinkMixin {
144 }
145 class _UnicodeSubsetEncoderSink extends StringConversionSinkBase {
146 _UnicodeSubsetEncoderSink($_subsetMask, $_sink) {
147 this[_subsetMask] = $_subsetMask;
148 this[_sink] = $_sink;
149 super.StringConversionSinkBase();
150 }
151 close() {
152 this[_sink].close();
153 }
154 addSlice(source, start, end, isLast) {
155 core.RangeError.checkValidRange(start, end, source.length);
156 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
157 let codeUnit = source.codeUnitAt(i);
158 if ((dart.notNull(codeUnit) & ~dart.notNull(this[_subsetMask])) !== 0) {
159 throw new core.ArgumentError(`Source contains invalid character with c ode point: ${codeUnit}.`);
160 }
161 }
162 this[_sink].add(source.codeUnits.sublist(start, end));
163 if (isLast) {
164 this.close();
165 }
166 }
167 }
168 let _convertInvalid = Symbol('_convertInvalid');
169 class _UnicodeSubsetDecoder extends Converter$(core.List$(core.int), core.Stri ng) {
170 _UnicodeSubsetDecoder($_allowInvalid, $_subsetMask) {
171 this[_allowInvalid] = $_allowInvalid;
172 this[_subsetMask] = $_subsetMask;
173 super.Converter();
174 }
175 convert(bytes, start, end) {
176 if (start === void 0)
177 start = 0;
178 if (end === void 0)
179 end = null;
180 let byteCount = bytes.length;
181 core.RangeError.checkValidRange(start, end, byteCount);
182 if (end === null)
183 end = byteCount;
184 let length = dart.notNull(end) - dart.notNull(start);
185 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
186 let byte = bytes.get(i);
187 if ((dart.notNull(byte) & ~dart.notNull(this[_subsetMask])) !== 0) {
188 if (!dart.notNull(this[_allowInvalid])) {
189 throw new core.FormatException(`Invalid value in input: ${byte}`);
190 }
191 return this[_convertInvalid](bytes, start, end);
192 }
193 }
194 return new core.String.fromCharCodes(bytes, start, end);
195 }
196 [_convertInvalid](bytes, start, end) {
197 let buffer = new core.StringBuffer();
198 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
199 let value = bytes.get(i);
200 if ((dart.notNull(value) & ~dart.notNull(this[_subsetMask])) !== 0)
201 value = 65533;
202 buffer.writeCharCode(value);
203 }
204 return buffer.toString();
205 }
206 bind(stream) {
207 return dart.as(super.bind(stream), async.Stream$(core.String));
208 }
209 }
210 class AsciiDecoder extends _UnicodeSubsetDecoder {
211 AsciiDecoder(opt$) {
212 let allowInvalid = opt$.allowInvalid === void 0 ? false : opt$.allowInvali d;
213 super._UnicodeSubsetDecoder(allowInvalid, _ASCII_MASK);
214 }
215 startChunkedConversion(sink) {
216 let stringSink = null;
217 if (dart.is(sink, StringConversionSink)) {
218 stringSink = sink;
219 } else {
220 stringSink = new StringConversionSink.from(sink);
221 }
222 if (this[_allowInvalid]) {
223 return new _ErrorHandlingAsciiDecoderSink(stringSink.asUtf8Sink(false));
224 } else {
225 return new _SimpleAsciiDecoderSink(stringSink);
226 }
227 }
228 }
229 let _utf8Sink = Symbol('_utf8Sink');
230 let ChunkedConversionSink$ = dart.generic(function(T) {
231 class ChunkedConversionSink extends core.Object {
232 ChunkedConversionSink() {
233 }
234 ChunkedConversionSink$withCallback(callback) {
235 return new _SimpleCallbackSink(callback);
236 }
237 }
238 dart.defineNamedConstructor(ChunkedConversionSink, 'withCallback');
239 return ChunkedConversionSink;
240 });
241 let ChunkedConversionSink = ChunkedConversionSink$(dart.dynamic);
242 class ByteConversionSink extends ChunkedConversionSink$(core.List$(core.int)) {
243 ByteConversionSink() {
244 super.ChunkedConversionSink();
245 }
246 ByteConversionSink$withCallback(callback) {
247 return new _ByteCallbackSink(callback);
248 }
249 ByteConversionSink$from(sink) {
250 return new _ByteAdapterSink(sink);
251 }
252 }
253 dart.defineNamedConstructor(ByteConversionSink, 'withCallback');
254 dart.defineNamedConstructor(ByteConversionSink, 'from');
255 class ByteConversionSinkBase extends ByteConversionSink {
256 addSlice(chunk, start, end, isLast) {
257 this.add(chunk.sublist(start, end));
258 if (isLast)
259 this.close();
260 }
261 }
262 class _ErrorHandlingAsciiDecoderSink extends ByteConversionSinkBase {
263 _ErrorHandlingAsciiDecoderSink($_utf8Sink) {
264 this[_utf8Sink] = $_utf8Sink;
265 super.ByteConversionSinkBase();
266 }
267 close() {
268 this[_utf8Sink].close();
269 }
270 add(source) {
271 this.addSlice(source, 0, source.length, false);
272 }
273 addSlice(source, start, end, isLast) {
274 core.RangeError.checkValidRange(start, end, source.length);
275 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
276 if ((dart.notNull(source.get(i)) & ~dart.notNull(_ASCII_MASK)) !== 0) {
277 if (dart.notNull(i) > dart.notNull(start))
278 this[_utf8Sink].addSlice(source, start, i, false);
279 this[_utf8Sink].add(/* Unimplemented const */new List.from([239, 191, 189]));
280 start = dart.notNull(i) + 1;
281 }
282 }
283 if (dart.notNull(start) < dart.notNull(end)) {
284 this[_utf8Sink].addSlice(source, start, end, isLast);
285 } else if (isLast) {
286 this.close();
287 }
288 }
289 }
290 class _SimpleAsciiDecoderSink extends ByteConversionSinkBase {
291 _SimpleAsciiDecoderSink($_sink) {
292 this[_sink] = $_sink;
293 super.ByteConversionSinkBase();
294 }
295 close() {
296 this[_sink].close();
297 }
298 add(source) {
299 for (let i = 0; dart.notNull(i) < dart.notNull(source.length); i = dart.no tNull(i) + 1) {
300 if ((dart.notNull(source.get(i)) & ~dart.notNull(_ASCII_MASK)) !== 0) {
301 throw new core.FormatException("Source contains non-ASCII bytes.");
302 }
303 }
304 this[_sink].add(new core.String.fromCharCodes(source));
305 }
306 addSlice(source, start, end, isLast) {
307 let length = source.length;
308 core.RangeError.checkValidRange(start, end, length);
309 if (dart.notNull(start) < dart.notNull(end)) {
310 if (start !== 0 || end !== length) {
311 source = source.sublist(start, end);
312 }
313 this.add(source);
314 }
315 if (isLast)
316 this.close();
317 }
318 }
319 class _ByteAdapterSink extends ByteConversionSinkBase {
320 _ByteAdapterSink($_sink) {
321 this[_sink] = $_sink;
322 super.ByteConversionSinkBase();
323 }
324 add(chunk) {
325 return this[_sink].add(chunk);
326 }
327 close() {
328 return this[_sink].close();
329 }
330 }
331 let _buffer = Symbol('_buffer');
332 let _callback = Symbol('_callback');
333 let _bufferIndex = Symbol('_bufferIndex');
334 let _roundToPowerOf2 = Symbol('_roundToPowerOf2');
335 class _ByteCallbackSink extends ByteConversionSinkBase {
336 _ByteCallbackSink(callback) {
337 this[_buffer] = new typed_data.Uint8List(_ByteCallbackSink._INITIAL_BUFFER _SIZE);
338 this[_callback] = callback;
339 this[_bufferIndex] = 0;
340 super.ByteConversionSinkBase();
341 }
342 add(chunk) {
343 let freeCount = dart.notNull(this[_buffer].length) - dart.notNull(this[_bu fferIndex]);
344 if (dart.notNull(chunk.length) > dart.notNull(freeCount)) {
345 let oldLength = this[_buffer].length;
346 let newLength = dart.notNull(_roundToPowerOf2(dart.notNull(chunk.length) + dart.notNull(oldLength))) * 2;
347 let grown = new typed_data.Uint8List(newLength);
348 grown.setRange(0, this[_buffer].length, this[_buffer]);
349 this[_buffer] = grown;
350 }
351 this[_buffer].setRange(this[_bufferIndex], dart.notNull(this[_bufferIndex] ) + dart.notNull(chunk.length), chunk);
352 this[_bufferIndex] = chunk.length;
353 }
354 static [_roundToPowerOf2](v) {
355 dart.assert(dart.notNull(v) > 0);
356 v = dart.notNull(v) - 1;
357 v = dart.notNull(v) >> 1;
358 v = dart.notNull(v) >> 2;
359 v = dart.notNull(v) >> 4;
360 v = dart.notNull(v) >> 8;
361 v = dart.notNull(v) >> 16;
362 v = dart.notNull(v) + 1;
363 return v;
364 }
365 close() {
366 this[_callback](this[_buffer].sublist(0, this[_bufferIndex]));
367 }
368 }
369 _ByteCallbackSink._INITIAL_BUFFER_SIZE = 1024;
370 let _accumulated = Symbol('_accumulated');
371 let _SimpleCallbackSink$ = dart.generic(function(T) {
372 class _SimpleCallbackSink extends ChunkedConversionSink$(T) {
373 _SimpleCallbackSink($_callback) {
374 this[_accumulated] = new List.from([]);
375 this[_callback] = $_callback;
376 super.ChunkedConversionSink();
377 }
378 add(chunk) {
379 this[_accumulated].add(chunk);
380 }
381 close() {
382 this[_callback](this[_accumulated]);
383 }
384 }
385 return _SimpleCallbackSink;
386 });
387 let _SimpleCallbackSink = _SimpleCallbackSink$(dart.dynamic);
388 let _EventSinkAdapter$ = dart.generic(function(T) {
389 class _EventSinkAdapter extends core.Object {
390 _EventSinkAdapter($_sink) {
391 this[_sink] = $_sink;
392 }
393 add(data) {
394 return this[_sink].add(data);
395 }
396 close() {
397 return this[_sink].close();
398 }
399 }
400 return _EventSinkAdapter;
401 });
402 let _EventSinkAdapter = _EventSinkAdapter$(dart.dynamic);
403 let _eventSink = Symbol('_eventSink');
404 let _chunkedSink = Symbol('_chunkedSink');
405 let _ConverterStreamEventSink$ = dart.generic(function(S, T) {
406 class _ConverterStreamEventSink extends core.Object {
407 _ConverterStreamEventSink(converter, sink) {
408 this[_eventSink] = sink;
409 this[_chunkedSink] = converter.startChunkedConversion(sink);
410 }
411 add(o) {
412 return this[_chunkedSink].add(o);
413 }
414 addError(error, stackTrace) {
415 if (stackTrace === void 0)
416 stackTrace = null;
417 this[_eventSink].addError(error, stackTrace);
418 }
419 close() {
420 return this[_chunkedSink].close();
421 }
422 }
423 return _ConverterStreamEventSink;
424 });
425 let _ConverterStreamEventSink = _ConverterStreamEventSink$(dart.dynamic, dart. dynamic);
426 let _first = Symbol('_first');
427 let _second = Symbol('_second');
428 let _FusedCodec$ = dart.generic(function(S, M, T) {
429 class _FusedCodec extends Codec$(S, T) {
430 get encoder() {
431 return dart.as(this[_first].encoder.fuse(this[_second].encoder), Convert er$(S, T));
432 }
433 get decoder() {
434 return dart.as(this[_second].decoder.fuse(this[_first].decoder), Convert er$(T, S));
435 }
436 _FusedCodec($_first, $_second) {
437 this[_first] = $_first;
438 this[_second] = $_second;
439 super.Codec();
440 }
441 }
442 return _FusedCodec;
443 });
444 let _FusedCodec = _FusedCodec$(dart.dynamic, dart.dynamic, dart.dynamic);
445 let _codec = Symbol('_codec');
446 let _InvertedCodec$ = dart.generic(function(T, S) {
447 class _InvertedCodec extends Codec$(T, S) {
448 _InvertedCodec(codec) {
449 this[_codec] = codec;
450 super.Codec();
451 }
452 get encoder() {
453 return this[_codec].decoder;
454 }
455 get decoder() {
456 return this[_codec].encoder;
457 }
458 get inverted() {
459 return this[_codec];
460 }
461 }
462 return _InvertedCodec;
463 });
464 let _InvertedCodec = _InvertedCodec$(dart.dynamic, dart.dynamic);
465 let _FusedConverter$ = dart.generic(function(S, M, T) {
466 class _FusedConverter extends Converter$(S, T) {
467 _FusedConverter($_first, $_second) {
468 this[_first] = $_first;
469 this[_second] = $_second;
470 super.Converter();
471 }
472 convert(input) {
473 return dart.as(this[_second].convert(this[_first].convert(input)), T);
474 }
475 startChunkedConversion(sink) {
476 return this[_first].startChunkedConversion(this[_second].startChunkedCon version(sink));
477 }
478 }
479 return _FusedConverter;
480 });
481 let _FusedConverter = _FusedConverter$(dart.dynamic, dart.dynamic, dart.dynami c);
482 let HTML_ESCAPE = new HtmlEscape();
483 let _name = Symbol('_name');
484 class HtmlEscapeMode extends core.Object {
485 HtmlEscapeMode$_($_name, escapeLtGt, escapeQuot, escapeApos, escapeSlash) {
486 this[_name] = $_name;
487 this.escapeLtGt = escapeLtGt;
488 this.escapeQuot = escapeQuot;
489 this.escapeApos = escapeApos;
490 this.escapeSlash = escapeSlash;
491 }
492 toString() {
493 return this[_name];
494 }
495 }
496 dart.defineNamedConstructor(HtmlEscapeMode, '_');
497 HtmlEscapeMode.UNKNOWN = new HtmlEscapeMode._('unknown', true, true, true, tru e);
498 HtmlEscapeMode.ATTRIBUTE = new HtmlEscapeMode._('attribute', false, true, fals e, false);
499 HtmlEscapeMode.ELEMENT = new HtmlEscapeMode._('element', true, false, false, t rue);
500 let _convert = Symbol('_convert');
501 class HtmlEscape extends Converter$(core.String, core.String) {
502 HtmlEscape(mode) {
503 if (mode === void 0)
504 mode = HtmlEscapeMode.UNKNOWN;
505 this.mode = mode;
506 super.Converter();
507 }
508 convert(text) {
509 let val = this[_convert](text, 0, text.length);
510 return val === null ? text : val;
511 }
512 [_convert](text, start, end) {
513 let result = null;
514 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
515 let ch = text.get(i);
516 let replace = null;
517 switch (ch) {
518 case '&':
519 replace = '&amp;';
520 break;
521 case ' ':
522 replace = '&nbsp;';
523 break;
524 case '"':
525 if (this.mode.escapeQuot)
526 replace = '&quot;';
527 break;
528 case "'":
529 if (this.mode.escapeApos)
530 replace = '&#x27;';
531 break;
532 case '<':
533 if (this.mode.escapeLtGt)
534 replace = '&lt;';
535 break;
536 case '>':
537 if (this.mode.escapeLtGt)
538 replace = '&gt;';
539 break;
540 case '/':
541 if (this.mode.escapeSlash)
542 replace = '&#x2F;';
543 break;
544 }
545 if (replace !== null) {
546 if (result === null)
547 result = new core.StringBuffer(text.substring(start, i));
548 result.write(replace);
549 } else if (result !== null) {
550 result.write(ch);
551 }
552 }
553 return result !== null ? result.toString() : null;
554 }
555 startChunkedConversion(sink) {
556 if (!dart.is(sink, StringConversionSink)) {
557 sink = new StringConversionSink.from(sink);
558 }
559 return new _HtmlEscapeSink(this, dart.as(sink, StringConversionSink));
560 }
561 }
562 let _escape = Symbol('_escape');
563 class _HtmlEscapeSink extends StringConversionSinkBase {
564 _HtmlEscapeSink($_escape, $_sink) {
565 this[_escape] = $_escape;
566 this[_sink] = $_sink;
567 super.StringConversionSinkBase();
568 }
569 addSlice(chunk, start, end, isLast) {
570 let val = this[_escape]._convert(chunk, start, end);
571 if (val === null) {
572 this[_sink].addSlice(chunk, start, end, isLast);
573 } else {
574 this[_sink].add(val);
575 if (isLast)
576 this[_sink].close();
577 }
578 }
579 close() {
580 return this[_sink].close();
581 }
582 }
583 class JsonUnsupportedObjectError extends core.Error {
584 JsonUnsupportedObjectError(unsupportedObject, opt$) {
585 let cause = opt$.cause === void 0 ? null : opt$.cause;
586 this.unsupportedObject = unsupportedObject;
587 this.cause = cause;
588 super.Error();
589 }
590 toString() {
591 if (this.cause !== null) {
592 return "Converting object to an encodable object failed.";
593 } else {
594 return "Converting object did not return an encodable object.";
595 }
596 }
597 }
598 class JsonCyclicError extends JsonUnsupportedObjectError {
599 JsonCyclicError(object) {
600 super.JsonUnsupportedObjectError(object);
601 }
602 toString() {
603 return "Cyclic error in JSON stringify";
604 }
605 }
606 let JSON = new JsonCodec();
607 let _reviver = Symbol('_reviver');
608 let _toEncodable = Symbol('_toEncodable');
609 class JsonCodec extends Codec$(core.Object, core.String) {
610 JsonCodec(opt$) {
611 let reviver = opt$.reviver === void 0 ? null : opt$.reviver;
612 let toEncodable = opt$.toEncodable === void 0 ? null : opt$.toEncodable;
613 this[_reviver] = reviver;
614 this[_toEncodable] = toEncodable;
615 super.Codec();
616 }
617 JsonCodec$withReviver(reviver) {
618 this.JsonCodec({reviver: reviver});
619 }
620 decode(source, opt$) {
621 let reviver = opt$.reviver === void 0 ? null : opt$.reviver;
622 if (reviver === null)
623 reviver = this[_reviver];
624 if (reviver === null)
625 return this.decoder.convert(source);
626 return new JsonDecoder(reviver).convert(source);
627 }
628 encode(value, opt$) {
629 let toEncodable = opt$.toEncodable === void 0 ? null : opt$.toEncodable;
630 if (toEncodable === null)
631 toEncodable = this[_toEncodable];
632 if (toEncodable === null)
633 return this.encoder.convert(value);
634 return new JsonEncoder(dart.closureWrap(toEncodable, "(Object) → Object")) .convert(value);
635 }
636 get encoder() {
637 if (this[_toEncodable] === null)
638 return new JsonEncoder();
639 return new JsonEncoder(dart.closureWrap(this[_toEncodable], "(Object) → Ob ject"));
640 }
641 get decoder() {
642 if (this[_reviver] === null)
643 return new JsonDecoder();
644 return new JsonDecoder(this[_reviver]);
645 }
646 }
647 dart.defineNamedConstructor(JsonCodec, 'withReviver');
648 class JsonEncoder extends Converter$(core.Object, core.String) {
649 JsonEncoder(toEncodable) {
650 if (toEncodable === void 0)
651 toEncodable = null;
652 this.indent = null;
653 this[_toEncodable] = toEncodable;
654 super.Converter();
655 }
656 JsonEncoder$withIndent(indent, toEncodable) {
657 if (toEncodable === void 0)
658 toEncodable = null;
659 this.indent = indent;
660 this[_toEncodable] = toEncodable;
661 super.Converter();
662 }
663 convert(object) {
664 return _JsonStringStringifier.stringify(object, dart.as(this[_toEncodable] , dart.throw_("Unimplemented type (dynamic) → dynamic")), this.indent);
665 }
666 startChunkedConversion(sink) {
667 if (!dart.is(sink, StringConversionSink)) {
668 sink = new StringConversionSink.from(sink);
669 } else if (dart.is(sink, _Utf8EncoderSink)) {
670 return new _JsonUtf8EncoderSink(sink[_sink], this[_toEncodable], JsonUtf 8Encoder._utf8Encode(this.indent), JsonUtf8Encoder.DEFAULT_BUFFER_SIZE);
671 }
672 return new _JsonEncoderSink(dart.as(sink, StringConversionSink), this[_toE ncodable], this.indent);
673 }
674 bind(stream) {
675 return dart.as(super.bind(stream), async.Stream$(core.String));
676 }
677 fuse(other) {
678 if (dart.is(other, Utf8Encoder)) {
679 return new JsonUtf8Encoder(this.indent, dart.as(this[_toEncodable], dart .throw_("Unimplemented type (Object) → dynamic")));
680 }
681 return super.fuse(other);
682 }
683 }
684 dart.defineNamedConstructor(JsonEncoder, 'withIndent');
685 let _indent = Symbol('_indent');
686 let _bufferSize = Symbol('_bufferSize');
687 let _utf8Encode = Symbol('_utf8Encode');
688 class JsonUtf8Encoder extends Converter$(core.Object, core.List$(core.int)) {
689 JsonUtf8Encoder(indent, toEncodable, bufferSize) {
690 if (indent === void 0)
691 indent = null;
692 if (toEncodable === void 0)
693 toEncodable = null;
694 if (bufferSize === void 0)
695 bufferSize = JsonUtf8Encoder.DEFAULT_BUFFER_SIZE;
696 this[_indent] = _utf8Encode(indent);
697 this[_toEncodable] = toEncodable;
698 this[_bufferSize] = bufferSize;
699 super.Converter();
700 }
701 static [_utf8Encode](string) {
702 if (string === null)
703 return null;
704 if (string.isEmpty)
705 return new typed_data.Uint8List(0);
706 checkAscii: {
707 for (let i = 0; dart.notNull(i) < dart.notNull(string.length); i = dart. notNull(i) + 1) {
708 if (dart.notNull(string.codeUnitAt(i)) >= 128)
709 break checkAscii;
710 }
711 return string.codeUnits;
712 }
713 return UTF8.encode(string);
714 }
715 convert(object) {
716 let bytes = dart.as(new List.from([]), core.List$(core.List$(core.int)));
717 // Function addChunk: (Uint8List, int, int) → void
718 function addChunk(chunk, start, end) {
719 if (dart.notNull(start) > 0 || dart.notNull(end) < dart.notNull(chunk.le ngth)) {
720 let length = dart.notNull(end) - dart.notNull(start);
721 chunk = new typed_data.Uint8List.view(chunk.buffer, dart.notNull(chunk .offsetInBytes) + dart.notNull(start), length);
722 }
723 bytes.add(chunk);
724 }
725 _JsonUtf8Stringifier.stringify(object, this[_indent], dart.as(this[_toEnco dable], dart.throw_("Unimplemented type (Object) → dynamic")), this[_bufferSize] , addChunk);
726 if (bytes.length === 1)
727 return bytes.get(0);
728 let length = 0;
729 for (let i = 0; dart.notNull(i) < dart.notNull(bytes.length); i = dart.not Null(i) + 1) {
730 length = bytes.get(i).length;
731 }
732 let result = new typed_data.Uint8List(length);
733 for (let i = 0, offset = 0; dart.notNull(i) < dart.notNull(bytes.length); i = dart.notNull(i) + 1) {
734 let byteList = bytes.get(i);
735 let end = dart.notNull(offset) + dart.notNull(byteList.length);
736 result.setRange(offset, end, byteList);
737 offset = end;
738 }
739 return result;
740 }
741 startChunkedConversion(sink) {
742 let byteSink = null;
743 if (dart.is(sink, ByteConversionSink)) {
744 byteSink = sink;
745 } else {
746 byteSink = new ByteConversionSink.from(sink);
747 }
748 return new _JsonUtf8EncoderSink(byteSink, this[_toEncodable], this[_indent ], this[_bufferSize]);
749 }
750 bind(stream) {
751 return dart.as(super.bind(stream), async.Stream$(core.List$(core.int)));
752 }
753 fuse(other) {
754 return super.fuse(other);
755 }
756 }
757 JsonUtf8Encoder.DEFAULT_BUFFER_SIZE = 256;
758 let _isDone = Symbol('_isDone');
759 class _JsonEncoderSink extends ChunkedConversionSink$(core.Object) {
760 _JsonEncoderSink($_sink, $_toEncodable, $_indent) {
761 this[_sink] = $_sink;
762 this[_toEncodable] = $_toEncodable;
763 this[_indent] = $_indent;
764 this[_isDone] = false;
765 super.ChunkedConversionSink();
766 }
767 add(o) {
768 if (this[_isDone]) {
769 throw new core.StateError("Only one call to add allowed");
770 }
771 this[_isDone] = true;
772 let stringSink = this[_sink].asStringSink();
773 _JsonStringStringifier.printOn(o, stringSink, dart.as(this[_toEncodable], dart.throw_("Unimplemented type (dynamic) → dynamic")), this[_indent]);
774 stringSink.close();
775 }
776 close() {}
777 }
778 let _addChunk = Symbol('_addChunk');
779 class _JsonUtf8EncoderSink extends ChunkedConversionSink$(core.Object) {
780 _JsonUtf8EncoderSink($_sink, $_toEncodable, $_indent, $_bufferSize) {
781 this[_sink] = $_sink;
782 this[_toEncodable] = $_toEncodable;
783 this[_indent] = $_indent;
784 this[_bufferSize] = $_bufferSize;
785 this[_isDone] = false;
786 super.ChunkedConversionSink();
787 }
788 [_addChunk](chunk, start, end) {
789 this[_sink].addSlice(chunk, start, end, false);
790 }
791 add(object) {
792 if (this[_isDone]) {
793 throw new core.StateError("Only one call to add allowed");
794 }
795 this[_isDone] = true;
796 _JsonUtf8Stringifier.stringify(object, this[_indent], dart.as(this[_toEnco dable], dart.throw_("Unimplemented type (Object) → dynamic")), this[_bufferSize] , this[_addChunk]);
797 this[_sink].close();
798 }
799 close() {
800 if (!dart.notNull(this[_isDone])) {
801 this[_isDone] = true;
802 this[_sink].close();
803 }
804 }
805 }
806 class JsonDecoder extends Converter$(core.String, core.Object) {
807 JsonDecoder(reviver) {
808 if (reviver === void 0)
809 reviver = null;
810 this[_reviver] = reviver;
811 super.Converter();
812 }
813 convert(input) {
814 return _parseJson(input, this[_reviver]);
815 }
816 startChunkedConversion(sink) {
817 return new _JsonDecoderSink(this[_reviver], sink);
818 }
819 bind(stream) {
820 return dart.as(super.bind(stream), async.Stream$(core.Object));
821 }
822 }
823 // Function _parseJson: (String, (dynamic, dynamic) → dynamic) → dynamic
824 function _parseJson(source, reviver) {
825 if (!(typeof source == string))
826 throw new core.ArgumentError(source);
827 let parsed = null;
828 try {
829 parsed = JSON.parse(source);
830 } catch (e) {
831 throw new core.FormatException(String(e));
832 }
833
834 if (reviver === null) {
835 return _convertJsonToDartLazy(parsed);
836 } else {
837 return _convertJsonToDart(parsed, reviver);
838 }
839 }
840 // Function _defaultToEncodable: (dynamic) → Object
841 function _defaultToEncodable(object) {
842 return dart.dinvoke(object, 'toJson');
843 }
844 let _seen = Symbol('_seen');
845 let _checkCycle = Symbol('_checkCycle');
846 let _removeSeen = Symbol('_removeSeen');
847 class _JsonStringifier extends core.Object {
848 _JsonStringifier(_toEncodable) {
849 this[_seen] = new core.List();
850 this[_toEncodable] = dart.as(_toEncodable !== null ? _toEncodable : _defau ltToEncodable, core.Function);
851 }
852 static hexDigit(x) {
853 return dart.notNull(x) < 10 ? 48 + dart.notNull(x) : 87 + dart.notNull(x);
854 }
855 writeStringContent(s) {
856 let offset = 0;
857 let length = s.length;
858 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull(i ) + 1) {
859 let charCode = s.codeUnitAt(i);
860 if (dart.notNull(charCode) > dart.notNull(_JsonStringifier.BACKSLASH))
861 continue;
862 if (dart.notNull(charCode) < 32) {
863 if (dart.notNull(i) > dart.notNull(offset))
864 this.writeStringSlice(s, offset, i);
865 offset = dart.notNull(i) + 1;
866 this.writeCharCode(_JsonStringifier.BACKSLASH);
867 switch (charCode) {
868 case _JsonStringifier.BACKSPACE:
869 this.writeCharCode(_JsonStringifier.CHAR_b);
870 break;
871 case _JsonStringifier.TAB:
872 this.writeCharCode(_JsonStringifier.CHAR_t);
873 break;
874 case _JsonStringifier.NEWLINE:
875 this.writeCharCode(_JsonStringifier.CHAR_n);
876 break;
877 case _JsonStringifier.FORM_FEED:
878 this.writeCharCode(_JsonStringifier.CHAR_f);
879 break;
880 case _JsonStringifier.CARRIAGE_RETURN:
881 this.writeCharCode(_JsonStringifier.CHAR_r);
882 break;
883 default:
884 this.writeCharCode(_JsonStringifier.CHAR_u);
885 this.writeCharCode(_JsonStringifier.CHAR_0);
886 this.writeCharCode(_JsonStringifier.CHAR_0);
887 this.writeCharCode(hexDigit(dart.notNull(charCode) >> 4 & 15));
888 this.writeCharCode(hexDigit(dart.notNull(charCode) & 15));
889 break;
890 }
891 } else if (charCode === _JsonStringifier.QUOTE || charCode === _JsonStri ngifier.BACKSLASH) {
892 if (dart.notNull(i) > dart.notNull(offset))
893 this.writeStringSlice(s, offset, i);
894 offset = dart.notNull(i) + 1;
895 this.writeCharCode(_JsonStringifier.BACKSLASH);
896 this.writeCharCode(charCode);
897 }
898 }
899 if (offset === 0) {
900 this.writeString(s);
901 } else if (dart.notNull(offset) < dart.notNull(length)) {
902 this.writeStringSlice(s, offset, length);
903 }
904 }
905 [_checkCycle](object) {
906 for (let i = 0; dart.notNull(i) < dart.notNull(this[_seen].length); i = da rt.notNull(i) + 1) {
907 if (core.identical(object, this[_seen].get(i))) {
908 throw new JsonCyclicError(object);
909 }
910 }
911 this[_seen].add(object);
912 }
913 [_removeSeen](object) {
914 dart.assert(!dart.notNull(this[_seen].isEmpty));
915 dart.assert(core.identical(this[_seen].last, object));
916 this[_seen].removeLast();
917 }
918 writeObject(object) {
919 if (this.writeJsonValue(object))
920 return;
921 this[_checkCycle](object);
922 try {
923 let customJson = dart.dinvokef(this[_toEncodable], object);
924 if (!dart.notNull(this.writeJsonValue(customJson))) {
925 throw new JsonUnsupportedObjectError(object);
926 }
927 this[_removeSeen](object);
928 } catch (e) {
929 throw new JsonUnsupportedObjectError(object, {cause: e});
930 }
931
932 }
933 writeJsonValue(object) {
934 if (dart.is(object, core.num)) {
935 if (dart.dunary('!', dart.dload(object, 'isFinite')))
936 return false;
937 this.writeNumber(dart.as(object, core.num));
938 return true;
939 } else if (core.identical(object, true)) {
940 this.writeString('true');
941 return true;
942 } else if (core.identical(object, false)) {
943 this.writeString('false');
944 return true;
945 } else if (object === null) {
946 this.writeString('null');
947 return true;
948 } else if (typeof object == string) {
949 this.writeString('"');
950 this.writeStringContent(dart.as(object, core.String));
951 this.writeString('"');
952 return true;
953 } else if (dart.is(object, core.List)) {
954 this[_checkCycle](object);
955 this.writeList(dart.as(object, core.List));
956 this[_removeSeen](object);
957 return true;
958 } else if (dart.is(object, core.Map)) {
959 this[_checkCycle](object);
960 this.writeMap(dart.as(object, core.Map$(core.String, core.Object)));
961 this[_removeSeen](object);
962 return true;
963 } else {
964 return false;
965 }
966 }
967 writeList(list) {
968 this.writeString('[');
969 if (dart.notNull(list.length) > 0) {
970 this.writeObject(list.get(0));
971 for (let i = 1; dart.notNull(i) < dart.notNull(list.length); i = dart.no tNull(i) + 1) {
972 this.writeString(',');
973 this.writeObject(list.get(i));
974 }
975 }
976 this.writeString(']');
977 }
978 writeMap(map) {
979 this.writeString('{');
980 let separator = '"';
981 map.forEach(dart.closureWrap(((key, value) => {
982 this.writeString(separator);
983 separator = ',"';
984 this.writeStringContent(key);
985 this.writeString('":');
986 this.writeObject(value);
987 }).bind(this), "(String, Object) → void"));
988 this.writeString('}');
989 }
990 }
991 _JsonStringifier.BACKSPACE = 8;
992 _JsonStringifier.TAB = 9;
993 _JsonStringifier.NEWLINE = 10;
994 _JsonStringifier.CARRIAGE_RETURN = 13;
995 _JsonStringifier.FORM_FEED = 12;
996 _JsonStringifier.QUOTE = 34;
997 _JsonStringifier.CHAR_0 = 48;
998 _JsonStringifier.BACKSLASH = 92;
999 _JsonStringifier.CHAR_b = 98;
1000 _JsonStringifier.CHAR_f = 102;
1001 _JsonStringifier.CHAR_n = 110;
1002 _JsonStringifier.CHAR_r = 114;
1003 _JsonStringifier.CHAR_t = 116;
1004 _JsonStringifier.CHAR_u = 117;
1005 let _indentLevel = Symbol('_indentLevel');
1006 class _JsonPrettyPrintMixin extends core.Object {
1007 _JsonPrettyPrintMixin() {
1008 this[_indentLevel] = 0;
1009 }
1010 writeList(list) {
1011 if (list.isEmpty) {
1012 this.writeString('[]');
1013 } else {
1014 this.writeString('[\n');
1015 this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1;
1016 this.writeIndentation(this[_indentLevel]);
1017 this.writeObject(list.get(0));
1018 for (let i = 1; dart.notNull(i) < dart.notNull(list.length); i = dart.no tNull(i) + 1) {
1019 this.writeString(',\n');
1020 this.writeIndentation(this[_indentLevel]);
1021 this.writeObject(list.get(i));
1022 }
1023 this.writeString('\n');
1024 this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
1025 this.writeIndentation(this[_indentLevel]);
1026 this.writeString(']');
1027 }
1028 }
1029 writeMap(map) {
1030 if (map.isEmpty) {
1031 this.writeString('{}');
1032 } else {
1033 this.writeString('{\n');
1034 this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1;
1035 let first = true;
1036 map.forEach(((key, value) => {
1037 if (!dart.notNull(first)) {
1038 this.writeString(",\n");
1039 }
1040 this.writeIndentation(this[_indentLevel]);
1041 this.writeString('"');
1042 this.writeStringContent(key);
1043 this.writeString('": ');
1044 this.writeObject(value);
1045 first = false;
1046 }).bind(this));
1047 this.writeString('\n');
1048 this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
1049 this.writeIndentation(this[_indentLevel]);
1050 this.writeString('}');
1051 }
1052 }
1053 }
1054 class _JsonStringStringifier extends _JsonStringifier {
1055 _JsonStringStringifier($_sink, _toEncodable) {
1056 this[_sink] = $_sink;
1057 super._JsonStringifier(dart.as(_toEncodable, dart.throw_("Unimplemented ty pe (Object) → Object")));
1058 }
1059 static stringify(object, toEncodable, indent) {
1060 let output = new core.StringBuffer();
1061 printOn(object, output, toEncodable, indent);
1062 return output.toString();
1063 }
1064 static printOn(object, output, toEncodable, indent) {
1065 let stringifier = null;
1066 if (indent === null) {
1067 stringifier = new _JsonStringStringifier(output, toEncodable);
1068 } else {
1069 stringifier = new _JsonStringStringifierPretty(output, toEncodable, inde nt);
1070 }
1071 dart.dinvoke(stringifier, 'writeObject', object);
1072 }
1073 writeNumber(number) {
1074 this[_sink].write(number.toString());
1075 }
1076 writeString(string) {
1077 this[_sink].write(string);
1078 }
1079 writeStringSlice(string, start, end) {
1080 this[_sink].write(string.substring(start, end));
1081 }
1082 writeCharCode(charCode) {
1083 this[_sink].writeCharCode(charCode);
1084 }
1085 }
1086 class _JsonStringStringifierPretty extends dart.mixin(_JsonStringStringifier, _JsonPrettyPrintMixin) {
1087 _JsonStringStringifierPretty(sink, toEncodable, $_indent) {
1088 this[_indent] = $_indent;
1089 super._JsonStringStringifier(sink, toEncodable);
1090 }
1091 writeIndentation(count) {
1092 for (let i = 0; dart.notNull(i) < dart.notNull(count); i = dart.notNull(i) + 1)
1093 this.writeString(this[_indent]);
1094 }
1095 }
1096 class _JsonUtf8Stringifier extends _JsonStringifier {
1097 _JsonUtf8Stringifier(toEncodable, bufferSize, addChunk) {
1098 this.addChunk = addChunk;
1099 this.bufferSize = bufferSize;
1100 this.buffer = new typed_data.Uint8List(bufferSize);
1101 this.index = 0;
1102 super._JsonStringifier(dart.as(toEncodable, dart.throw_("Unimplemented typ e (Object) → Object")));
1103 }
1104 static stringify(object, indent, toEncodableFunction, bufferSize, addChunk) {
1105 let stringifier = null;
1106 if (indent !== null) {
1107 stringifier = new _JsonUtf8StringifierPretty(toEncodableFunction, indent , bufferSize, addChunk);
1108 } else {
1109 stringifier = new _JsonUtf8Stringifier(toEncodableFunction, bufferSize, addChunk);
1110 }
1111 stringifier.writeObject(object);
1112 stringifier.flush();
1113 }
1114 flush() {
1115 if (dart.notNull(this.index) > 0) {
1116 dart.dinvokef(this.addChunk, this.buffer, 0, this.index);
1117 }
1118 this.buffer = null;
1119 this.index = 0;
1120 }
1121 writeNumber(number) {
1122 this.writeAsciiString(number.toString());
1123 }
1124 writeAsciiString(string) {
1125 for (let i = 0; dart.notNull(i) < dart.notNull(string.length); i = dart.no tNull(i) + 1) {
1126 let char = string.codeUnitAt(i);
1127 dart.assert(dart.notNull(char) <= 127);
1128 this.writeByte(char);
1129 }
1130 }
1131 writeString(string) {
1132 this.writeStringSlice(string, 0, string.length);
1133 }
1134 writeStringSlice(string, start, end) {
1135 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
1136 let char = string.codeUnitAt(i);
1137 if (dart.notNull(char) <= 127) {
1138 this.writeByte(char);
1139 } else {
1140 if ((dart.notNull(char) & 64512) === 55296 && dart.notNull(i) + 1 < da rt.notNull(end)) {
1141 let nextChar = string.codeUnitAt(dart.notNull(i) + 1);
1142 if ((dart.notNull(nextChar) & 64512) === 56320) {
1143 char = 65536 + ((dart.notNull(char) & 1023) << 10) + (dart.notNull (nextChar) & 1023);
1144 this.writeFourByteCharCode(char);
1145 i = dart.notNull(i) + 1;
1146 continue;
1147 }
1148 }
1149 this.writeMultiByteCharCode(char);
1150 }
1151 }
1152 }
1153 writeCharCode(charCode) {
1154 if (dart.notNull(charCode) <= 127) {
1155 this.writeByte(charCode);
1156 return;
1157 }
1158 this.writeMultiByteCharCode(charCode);
1159 }
1160 writeMultiByteCharCode(charCode) {
1161 if (dart.notNull(charCode) <= 2047) {
1162 this.writeByte(192 | dart.notNull(charCode) >> 6);
1163 this.writeByte(128 | dart.notNull(charCode) & 63);
1164 return;
1165 }
1166 if (dart.notNull(charCode) <= 65535) {
1167 this.writeByte(224 | dart.notNull(charCode) >> 12);
1168 this.writeByte(128 | dart.notNull(charCode) >> 6 & 63);
1169 this.writeByte(128 | dart.notNull(charCode) & 63);
1170 return;
1171 }
1172 this.writeFourByteCharCode(charCode);
1173 }
1174 writeFourByteCharCode(charCode) {
1175 dart.assert(dart.notNull(charCode) <= 1114111);
1176 this.writeByte(240 | dart.notNull(charCode) >> 18);
1177 this.writeByte(128 | dart.notNull(charCode) >> 12 & 63);
1178 this.writeByte(128 | dart.notNull(charCode) >> 6 & 63);
1179 this.writeByte(128 | dart.notNull(charCode) & 63);
1180 }
1181 writeByte(byte) {
1182 dart.assert(dart.notNull(byte) <= 255);
1183 if (this.index === this.buffer.length) {
1184 dart.dinvokef(this.addChunk, this.buffer, 0, this.index);
1185 this.buffer = new typed_data.Uint8List(this.bufferSize);
1186 this.index = 0;
1187 }
1188 this.buffer.set((($tmp) => this.index = dart.notNull($tmp) + 1, $tmp).bind (this)(this.index), byte);
1189 }
1190 }
1191 class _JsonUtf8StringifierPretty extends dart.mixin(_JsonUtf8Stringifier, _Jso nPrettyPrintMixin) {
1192 _JsonUtf8StringifierPretty(toEncodableFunction, indent, bufferSize, addChunk ) {
1193 this.indent = indent;
1194 super._JsonUtf8Stringifier(toEncodableFunction, dart.as(bufferSize, core.i nt), dart.as(addChunk, core.Function));
1195 }
1196 writeIndentation(count) {
1197 let indent = this.indent;
1198 let indentLength = indent.length;
1199 if (indentLength === 1) {
1200 let char = indent.get(0);
1201 while (dart.notNull(count) > 0) {
1202 this.writeByte(char);
1203 count = 1;
1204 }
1205 return;
1206 }
1207 while (dart.notNull(count) > 0) {
1208 count = dart.notNull(count) - 1;
1209 let end = dart.notNull(this.index) + dart.notNull(indentLength);
1210 if (dart.notNull(end) <= dart.notNull(this.buffer.length)) {
1211 this.buffer.setRange(this.index, end, indent);
1212 this.index = end;
1213 } else {
1214 for (let i = 0; dart.notNull(i) < dart.notNull(indentLength); i = dart .notNull(i) + 1) {
1215 this.writeByte(indent.get(i));
1216 }
1217 }
1218 }
1219 }
1220 }
1221 let LATIN1 = new Latin1Codec();
1222 let _LATIN1_MASK = 255;
1223 class Latin1Codec extends Encoding {
1224 Latin1Codec(opt$) {
1225 let allowInvalid = opt$.allowInvalid === void 0 ? false : opt$.allowInvali d;
1226 this[_allowInvalid] = allowInvalid;
1227 super.Encoding();
1228 }
1229 get name() {
1230 return "iso-8859-1";
1231 }
1232 decode(bytes, opt$) {
1233 let allowInvalid = opt$.allowInvalid === void 0 ? null : opt$.allowInvalid ;
1234 if (allowInvalid === null)
1235 allowInvalid = this[_allowInvalid];
1236 if (allowInvalid) {
1237 return new Latin1Decoder({allowInvalid: true}).convert(bytes);
1238 } else {
1239 return new Latin1Decoder({allowInvalid: false}).convert(bytes);
1240 }
1241 }
1242 get encoder() {
1243 return new Latin1Encoder();
1244 }
1245 get decoder() {
1246 return this[_allowInvalid] ? new Latin1Decoder({allowInvalid: true}) : new Latin1Decoder({allowInvalid: false});
1247 }
1248 }
1249 class Latin1Encoder extends _UnicodeSubsetEncoder {
1250 Latin1Encoder() {
1251 super._UnicodeSubsetEncoder(_LATIN1_MASK);
1252 }
1253 }
1254 class Latin1Decoder extends _UnicodeSubsetDecoder {
1255 Latin1Decoder(opt$) {
1256 let allowInvalid = opt$.allowInvalid === void 0 ? false : opt$.allowInvali d;
1257 super._UnicodeSubsetDecoder(allowInvalid, _LATIN1_MASK);
1258 }
1259 startChunkedConversion(sink) {
1260 let stringSink = null;
1261 if (dart.is(sink, StringConversionSink)) {
1262 stringSink = sink;
1263 } else {
1264 stringSink = new StringConversionSink.from(sink);
1265 }
1266 if (!dart.notNull(this[_allowInvalid]))
1267 return new _Latin1DecoderSink(stringSink);
1268 return new _Latin1AllowInvalidDecoderSink(stringSink);
1269 }
1270 }
1271 let _addSliceToSink = Symbol('_addSliceToSink');
1272 class _Latin1DecoderSink extends ByteConversionSinkBase {
1273 _Latin1DecoderSink($_sink) {
1274 this[_sink] = $_sink;
1275 super.ByteConversionSinkBase();
1276 }
1277 close() {
1278 this[_sink].close();
1279 }
1280 add(source) {
1281 this.addSlice(source, 0, source.length, false);
1282 }
1283 [_addSliceToSink](source, start, end, isLast) {
1284 this[_sink].add(new core.String.fromCharCodes(source, start, end));
1285 if (isLast)
1286 this.close();
1287 }
1288 addSlice(source, start, end, isLast) {
1289 core.RangeError.checkValidRange(start, end, source.length);
1290 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
1291 let char = source.get(i);
1292 if (dart.notNull(char) > dart.notNull(_LATIN1_MASK) || dart.notNull(char ) < 0) {
1293 throw new core.FormatException("Source contains non-Latin-1 characters .");
1294 }
1295 }
1296 if (dart.notNull(start) < dart.notNull(end)) {
1297 this[_addSliceToSink](source, start, end, isLast);
1298 }
1299 if (isLast) {
1300 this.close();
1301 }
1302 }
1303 }
1304 class _Latin1AllowInvalidDecoderSink extends _Latin1DecoderSink {
1305 _Latin1AllowInvalidDecoderSink(sink) {
1306 super._Latin1DecoderSink(sink);
1307 }
1308 addSlice(source, start, end, isLast) {
1309 core.RangeError.checkValidRange(start, end, source.length);
1310 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
1311 let char = source.get(i);
1312 if (dart.notNull(char) > dart.notNull(_LATIN1_MASK) || dart.notNull(char ) < 0) {
1313 if (dart.notNull(i) > dart.notNull(start))
1314 this[_addSliceToSink](source, start, i, false);
1315 this[_addSliceToSink](dart.as(/* Unimplemented const */new List.from([ 65533]), core.List$(core.int)), 0, 1, false);
1316 start = dart.notNull(i) + 1;
1317 }
1318 }
1319 if (dart.notNull(start) < dart.notNull(end)) {
1320 this[_addSliceToSink](source, start, end, isLast);
1321 }
1322 if (isLast) {
1323 this.close();
1324 }
1325 }
1326 }
1327 class LineSplitter extends Converter$(core.String, core.List$(core.String)) {
1328 LineSplitter() {
1329 super.Converter();
1330 }
1331 convert(data) {
1332 let lines = new core.List();
1333 _LineSplitterSink._addSlice(data, 0, data.length, true, lines.add);
1334 return lines;
1335 }
1336 startChunkedConversion(sink) {
1337 if (!dart.is(sink, StringConversionSink)) {
1338 sink = new StringConversionSink.from(sink);
1339 }
1340 return new _LineSplitterSink(dart.as(sink, StringConversionSink));
1341 }
1342 }
1343 let _carry = Symbol('_carry');
1344 let _addSlice = Symbol('_addSlice');
1345 class _LineSplitterSink extends StringConversionSinkBase {
1346 _LineSplitterSink($_sink) {
1347 this[_sink] = $_sink;
1348 this[_carry] = null;
1349 super.StringConversionSinkBase();
1350 }
1351 addSlice(chunk, start, end, isLast) {
1352 if (this[_carry] !== null) {
1353 chunk = core.String['+'](this[_carry], chunk.substring(start, end));
1354 start = 0;
1355 end = chunk.length;
1356 this[_carry] = null;
1357 }
1358 this[_carry] = _addSlice(chunk, start, end, isLast, this[_sink].add);
1359 if (isLast)
1360 this[_sink].close();
1361 }
1362 close() {
1363 this.addSlice('', 0, 0, true);
1364 }
1365 static [_addSlice](chunk, start, end, isLast, adder) {
1366 let pos = start;
1367 while (dart.notNull(pos) < dart.notNull(end)) {
1368 let skip = 0;
1369 let char = chunk.codeUnitAt(pos);
1370 if (char === _LineSplitterSink._LF) {
1371 skip = 1;
1372 } else if (char === _LineSplitterSink._CR) {
1373 skip = 1;
1374 if (dart.notNull(pos) + 1 < dart.notNull(end)) {
1375 if (chunk.codeUnitAt(dart.notNull(pos) + 1) === _LineSplitterSink._L F) {
1376 skip = 2;
1377 }
1378 } else if (!dart.notNull(isLast)) {
1379 return chunk.substring(start, end);
1380 }
1381 }
1382 if (dart.notNull(skip) > 0) {
1383 adder(chunk.substring(start, pos));
1384 start = pos = dart.notNull(pos) + dart.notNull(skip);
1385 } else {
1386 pos = dart.notNull(pos) + 1;
1387 }
1388 }
1389 if (pos !== start) {
1390 let carry = chunk.substring(start, pos);
1391 if (isLast) {
1392 adder(carry);
1393 } else {
1394 return carry;
1395 }
1396 }
1397 return null;
1398 }
1399 }
1400 _LineSplitterSink._LF = 10;
1401 _LineSplitterSink._CR = 13;
1402 class StringConversionSink extends ChunkedConversionSink$(core.String) {
1403 StringConversionSink() {
1404 super.ChunkedConversionSink();
1405 }
1406 StringConversionSink$withCallback(callback) {
1407 return new _StringCallbackSink(callback);
1408 }
1409 StringConversionSink$from(sink) {
1410 return new _StringAdapterSink(sink);
1411 }
1412 StringConversionSink$fromStringSink(sink) {
1413 return new _StringSinkConversionSink(sink);
1414 }
1415 }
1416 dart.defineNamedConstructor(StringConversionSink, 'withCallback');
1417 dart.defineNamedConstructor(StringConversionSink, 'from');
1418 dart.defineNamedConstructor(StringConversionSink, 'fromStringSink');
1419 class ClosableStringSink extends core.StringSink {
1420 ClosableStringSink$fromStringSink(sink, onClose) {
1421 return new _ClosableStringSink(sink, onClose);
1422 }
1423 }
1424 dart.defineNamedConstructor(ClosableStringSink, 'fromStringSink');
1425 class _ClosableStringSink extends core.Object {
1426 _ClosableStringSink($_sink, $_callback) {
1427 this[_sink] = $_sink;
1428 this[_callback] = $_callback;
1429 }
1430 close() {
1431 return this[_callback]();
1432 }
1433 writeCharCode(charCode) {
1434 return this[_sink].writeCharCode(charCode);
1435 }
1436 write(o) {
1437 return this[_sink].write(o);
1438 }
1439 writeln(o) {
1440 if (o === void 0)
1441 o = "";
1442 return this[_sink].writeln(o);
1443 }
1444 writeAll(objects, separator) {
1445 if (separator === void 0)
1446 separator = "";
1447 return this[_sink].writeAll(objects, separator);
1448 }
1449 }
1450 let _flush = Symbol('_flush');
1451 class _StringConversionSinkAsStringSinkAdapter extends core.Object {
1452 _StringConversionSinkAsStringSinkAdapter($_chunkedSink) {
1453 this[_chunkedSink] = $_chunkedSink;
1454 this[_buffer] = new core.StringBuffer();
1455 }
1456 close() {
1457 if (this[_buffer].isNotEmpty)
1458 this[_flush]();
1459 this[_chunkedSink].close();
1460 }
1461 writeCharCode(charCode) {
1462 this[_buffer].writeCharCode(charCode);
1463 if (dart.notNull(this[_buffer].length) > dart.notNull(_StringConversionSin kAsStringSinkAdapter._MIN_STRING_SIZE))
1464 this[_flush]();
1465 }
1466 write(o) {
1467 if (this[_buffer].isNotEmpty)
1468 this[_flush]();
1469 let str = o.toString();
1470 this[_chunkedSink].add(o.toString());
1471 }
1472 writeln(o) {
1473 if (o === void 0)
1474 o = "";
1475 this[_buffer].writeln(o);
1476 if (dart.notNull(this[_buffer].length) > dart.notNull(_StringConversionSin kAsStringSinkAdapter._MIN_STRING_SIZE))
1477 this[_flush]();
1478 }
1479 writeAll(objects, separator) {
1480 if (separator === void 0)
1481 separator = "";
1482 if (this[_buffer].isNotEmpty)
1483 this[_flush]();
1484 let iterator = objects.iterator;
1485 if (!dart.notNull(iterator.moveNext()))
1486 return;
1487 if (separator.isEmpty) {
1488 do {
1489 this[_chunkedSink].add(dart.as(dart.dinvoke(iterator.current, 'toStrin g'), core.String));
1490 } while (iterator.moveNext());
1491 } else {
1492 this[_chunkedSink].add(dart.as(dart.dinvoke(iterator.current, 'toString' ), core.String));
1493 while (iterator.moveNext()) {
1494 this.write(separator);
1495 this[_chunkedSink].add(dart.as(dart.dinvoke(iterator.current, 'toStrin g'), core.String));
1496 }
1497 }
1498 }
1499 [_flush]() {
1500 let accumulated = this[_buffer].toString();
1501 this[_buffer].clear();
1502 this[_chunkedSink].add(accumulated);
1503 }
1504 }
1505 _StringConversionSinkAsStringSinkAdapter._MIN_STRING_SIZE = 16;
1506 let _stringSink = Symbol('_stringSink');
1507 class _StringSinkConversionSink extends StringConversionSinkBase {
1508 _StringSinkConversionSink($_stringSink) {
1509 this[_stringSink] = $_stringSink;
1510 super.StringConversionSinkBase();
1511 }
1512 close() {}
1513 addSlice(str, start, end, isLast) {
1514 if (start !== 0 || end !== str.length) {
1515 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul l(i) + 1) {
1516 this[_stringSink].writeCharCode(str.codeUnitAt(i));
1517 }
1518 } else {
1519 this[_stringSink].write(str);
1520 }
1521 if (isLast)
1522 this.close();
1523 }
1524 add(str) {
1525 return this[_stringSink].write(str);
1526 }
1527 asUtf8Sink(allowMalformed) {
1528 return new _Utf8StringSinkAdapter(this, this[_stringSink], allowMalformed) ;
1529 }
1530 asStringSink() {
1531 return new ClosableStringSink.fromStringSink(this[_stringSink], this.close );
1532 }
1533 }
1534 class _StringCallbackSink extends _StringSinkConversionSink {
1535 _StringCallbackSink($_callback) {
1536 this[_callback] = $_callback;
1537 super._StringSinkConversionSink(new core.StringBuffer());
1538 }
1539 close() {
1540 let buffer = dart.as(this[_stringSink], core.StringBuffer);
1541 let accumulated = buffer.toString();
1542 buffer.clear();
1543 this[_callback](accumulated);
1544 }
1545 asUtf8Sink(allowMalformed) {
1546 return new _Utf8StringSinkAdapter(this, this[_stringSink], allowMalformed) ;
1547 }
1548 }
1549 class _StringAdapterSink extends StringConversionSinkBase {
1550 _StringAdapterSink($_sink) {
1551 this[_sink] = $_sink;
1552 super.StringConversionSinkBase();
1553 }
1554 add(str) {
1555 return this[_sink].add(str);
1556 }
1557 addSlice(str, start, end, isLast) {
1558 if (start === 0 && end === str.length) {
1559 this.add(str);
1560 } else {
1561 this.add(str.substring(start, end));
1562 }
1563 if (isLast)
1564 this.close();
1565 }
1566 close() {
1567 return this[_sink].close();
1568 }
1569 }
1570 let _decoder = Symbol('_decoder');
1571 class _Utf8StringSinkAdapter extends ByteConversionSink {
1572 _Utf8StringSinkAdapter($_sink, stringSink, allowMalformed) {
1573 this[_sink] = $_sink;
1574 this[_decoder] = new _Utf8Decoder(stringSink, allowMalformed);
1575 super.ByteConversionSink();
1576 }
1577 close() {
1578 this[_decoder].close();
1579 if (this[_sink] !== null)
1580 this[_sink].close();
1581 }
1582 add(chunk) {
1583 this.addSlice(chunk, 0, chunk.length, false);
1584 }
1585 addSlice(codeUnits, startIndex, endIndex, isLast) {
1586 this[_decoder].convert(codeUnits, startIndex, endIndex);
1587 if (isLast)
1588 this.close();
1589 }
1590 }
1591 let _Utf8ConversionSink$_ = Symbol('_Utf8ConversionSink$_');
1592 class _Utf8ConversionSink extends ByteConversionSink {
1593 _Utf8ConversionSink(sink, allowMalformed) {
1594 this[_Utf8ConversionSink$_](sink, new core.StringBuffer(), allowMalformed) ;
1595 }
1596 _Utf8ConversionSink$_($_chunkedSink, stringBuffer, allowMalformed) {
1597 this[_chunkedSink] = $_chunkedSink;
1598 this[_decoder] = new _Utf8Decoder(stringBuffer, allowMalformed);
1599 this[_buffer] = stringBuffer;
1600 super.ByteConversionSink();
1601 }
1602 close() {
1603 this[_decoder].close();
1604 if (this[_buffer].isNotEmpty) {
1605 let accumulated = this[_buffer].toString();
1606 this[_buffer].clear();
1607 this[_chunkedSink].addSlice(accumulated, 0, accumulated.length, true);
1608 } else {
1609 this[_chunkedSink].close();
1610 }
1611 }
1612 add(chunk) {
1613 this.addSlice(chunk, 0, chunk.length, false);
1614 }
1615 addSlice(chunk, startIndex, endIndex, isLast) {
1616 this[_decoder].convert(chunk, startIndex, endIndex);
1617 if (this[_buffer].isNotEmpty) {
1618 let accumulated = this[_buffer].toString();
1619 this[_chunkedSink].addSlice(accumulated, 0, accumulated.length, isLast);
1620 this[_buffer].clear();
1621 return;
1622 }
1623 if (isLast)
1624 this.close();
1625 }
1626 }
1627 dart.defineNamedConstructor(_Utf8ConversionSink, '_');
1628 let UNICODE_REPLACEMENT_CHARACTER_RUNE = 65533;
1629 let UNICODE_BOM_CHARACTER_RUNE = 65279;
1630 let UTF8 = new Utf8Codec();
1631 let _allowMalformed = Symbol('_allowMalformed');
1632 class Utf8Codec extends Encoding {
1633 Utf8Codec(opt$) {
1634 let allowMalformed = opt$.allowMalformed === void 0 ? false : opt$.allowMa lformed;
1635 this[_allowMalformed] = allowMalformed;
1636 super.Encoding();
1637 }
1638 get name() {
1639 return "utf-8";
1640 }
1641 decode(codeUnits, opt$) {
1642 let allowMalformed = opt$.allowMalformed === void 0 ? null : opt$.allowMal formed;
1643 if (allowMalformed === null)
1644 allowMalformed = this[_allowMalformed];
1645 return new Utf8Decoder({allowMalformed: allowMalformed}).convert(codeUnits );
1646 }
1647 get encoder() {
1648 return new Utf8Encoder();
1649 }
1650 get decoder() {
1651 return new Utf8Decoder({allowMalformed: this[_allowMalformed]});
1652 }
1653 }
1654 class Utf8Encoder extends Converter$(core.String, core.List$(core.int)) {
1655 Utf8Encoder() {
1656 super.Converter();
1657 }
1658 convert(string, start, end) {
1659 if (start === void 0)
1660 start = 0;
1661 if (end === void 0)
1662 end = null;
1663 let stringLength = string.length;
1664 core.RangeError.checkValidRange(start, end, stringLength);
1665 if (end === null)
1666 end = stringLength;
1667 let length = dart.notNull(end) - dart.notNull(start);
1668 if (length === 0)
1669 return new typed_data.Uint8List(0);
1670 let encoder = new _Utf8Encoder.withBufferSize(dart.notNull(length) * 3);
1671 let endPosition = encoder._fillBuffer(string, start, end);
1672 dart.assert(dart.notNull(endPosition) >= dart.notNull(end) - 1);
1673 if (endPosition !== end) {
1674 let lastCodeUnit = string.codeUnitAt(dart.notNull(end) - 1);
1675 dart.assert(_isLeadSurrogate(lastCodeUnit));
1676 let wasCombined = encoder._writeSurrogate(lastCodeUnit, 0);
1677 dart.assert(!dart.notNull(wasCombined));
1678 }
1679 return encoder[_buffer].sublist(0, encoder[_bufferIndex]);
1680 }
1681 startChunkedConversion(sink) {
1682 if (!dart.is(sink, ByteConversionSink)) {
1683 sink = new ByteConversionSink.from(sink);
1684 }
1685 return new _Utf8EncoderSink(dart.as(sink, ByteConversionSink));
1686 }
1687 bind(stream) {
1688 return dart.as(super.bind(stream), async.Stream$(core.List$(core.int)));
1689 }
1690 }
1691 let _Utf8Encoder$withBufferSize = Symbol('_Utf8Encoder$withBufferSize');
1692 let _createBuffer = Symbol('_createBuffer');
1693 let _writeSurrogate = Symbol('_writeSurrogate');
1694 let _fillBuffer = Symbol('_fillBuffer');
1695 class _Utf8Encoder extends core.Object {
1696 _Utf8Encoder() {
1697 this[_Utf8Encoder$withBufferSize](_Utf8Encoder._DEFAULT_BYTE_BUFFER_SIZE);
1698 }
1699 _Utf8Encoder$withBufferSize(bufferSize) {
1700 this[_buffer] = _createBuffer(bufferSize);
1701 this[_carry] = 0;
1702 this[_bufferIndex] = 0;
1703 }
1704 static [_createBuffer](size) {
1705 return new typed_data.Uint8List(size);
1706 }
1707 [_writeSurrogate](leadingSurrogate, nextCodeUnit) {
1708 if (_isTailSurrogate(nextCodeUnit)) {
1709 let rune = _combineSurrogatePair(leadingSurrogate, nextCodeUnit);
1710 dart.assert(dart.notNull(rune) > dart.notNull(_THREE_BYTE_LIMIT));
1711 dart.assert(dart.notNull(rune) <= dart.notNull(_FOUR_BYTE_LIMIT));
1712 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1 , $tmp).bind(this)(this[_bufferIndex]), 240 | dart.notNull(rune) >> 18);
1713 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1 , $tmp).bind(this)(this[_bufferIndex]), 128 | dart.notNull(rune) >> 12 & 63);
1714 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1 , $tmp).bind(this)(this[_bufferIndex]), 128 | dart.notNull(rune) >> 6 & 63);
1715 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1 , $tmp).bind(this)(this[_bufferIndex]), 128 | dart.notNull(rune) & 63);
1716 return true;
1717 } else {
1718 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1 , $tmp).bind(this)(this[_bufferIndex]), 224 | dart.notNull(leadingSurrogate) >> 12);
1719 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1 , $tmp).bind(this)(this[_bufferIndex]), 128 | dart.notNull(leadingSurrogate) >> 6 & 63);
1720 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1 , $tmp).bind(this)(this[_bufferIndex]), 128 | dart.notNull(leadingSurrogate) & 6 3);
1721 return false;
1722 }
1723 }
1724 [_fillBuffer](str, start, end) {
1725 if (start !== end && dart.notNull(_isLeadSurrogate(str.codeUnitAt(dart.not Null(end) - 1)))) {
1726 end = dart.notNull(end) - 1;
1727 }
1728 let stringIndex = null;
1729 for (stringIndex = start; dart.notNull(stringIndex) < dart.notNull(end); s tringIndex = dart.notNull(stringIndex) + 1) {
1730 let codeUnit = str.codeUnitAt(stringIndex);
1731 if (dart.notNull(codeUnit) <= dart.notNull(_ONE_BYTE_LIMIT)) {
1732 if (dart.notNull(this[_bufferIndex]) >= dart.notNull(this[_buffer].len gth))
1733 break;
1734 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1, $tmp).bind(this)(this[_bufferIndex]), codeUnit);
1735 } else if (_isLeadSurrogate(codeUnit)) {
1736 if (dart.notNull(this[_bufferIndex]) + 3 >= dart.notNull(this[_buffer] .length))
1737 break;
1738 let nextCodeUnit = str.codeUnitAt(dart.notNull(stringIndex) + 1);
1739 let wasCombined = this[_writeSurrogate](codeUnit, nextCodeUnit);
1740 if (wasCombined)
1741 stringIndex = dart.notNull(stringIndex) + 1;
1742 } else {
1743 let rune = codeUnit;
1744 if (dart.notNull(rune) <= dart.notNull(_TWO_BYTE_LIMIT)) {
1745 if (dart.notNull(this[_bufferIndex]) + 1 >= dart.notNull(this[_buffe r].length))
1746 break;
1747 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1, $tmp).bind(this)(this[_bufferIndex]), 192 | dart.notNull(rune) >> 6);
1748 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1, $tmp).bind(this)(this[_bufferIndex]), 128 | dart.notNull(rune) & 63);
1749 } else {
1750 dart.assert(dart.notNull(rune) <= dart.notNull(_THREE_BYTE_LIMIT));
1751 if (dart.notNull(this[_bufferIndex]) + 2 >= dart.notNull(this[_buffe r].length))
1752 break;
1753 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1, $tmp).bind(this)(this[_bufferIndex]), 224 | dart.notNull(rune) >> 12);
1754 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1, $tmp).bind(this)(this[_bufferIndex]), 128 | dart.notNull(rune) >> 6 & 63);
1755 this[_buffer].set((($tmp) => this[_bufferIndex] = dart.notNull($tmp) + 1, $tmp).bind(this)(this[_bufferIndex]), 128 | dart.notNull(rune) & 63);
1756 }
1757 }
1758 }
1759 return stringIndex;
1760 }
1761 }
1762 dart.defineNamedConstructor(_Utf8Encoder, 'withBufferSize');
1763 _Utf8Encoder._DEFAULT_BYTE_BUFFER_SIZE = 1024;
1764 class _Utf8EncoderSink extends dart.mixin(_Utf8Encoder, StringConversionSinkMi xin) {
1765 _Utf8EncoderSink($_sink) {
1766 this[_sink] = $_sink;
1767 super._Utf8Encoder();
1768 }
1769 close() {
1770 if (this[_carry] !== 0) {
1771 this.addSlice("", 0, 0, true);
1772 return;
1773 }
1774 this[_sink].close();
1775 }
1776 addSlice(str, start, end, isLast) {
1777 this[_bufferIndex] = 0;
1778 if (start === end && !dart.notNull(isLast)) {
1779 return;
1780 }
1781 if (this[_carry] !== 0) {
1782 let nextCodeUnit = 0;
1783 if (start !== end) {
1784 nextCodeUnit = str.codeUnitAt(start);
1785 } else {
1786 dart.assert(isLast);
1787 }
1788 let wasCombined = this[_writeSurrogate](this[_carry], nextCodeUnit);
1789 dart.assert(!dart.notNull(wasCombined) || start !== end);
1790 if (wasCombined)
1791 start = dart.notNull(start) + 1;
1792 this[_carry] = 0;
1793 }
1794 do {
1795 start = this[_fillBuffer](str, start, end);
1796 let isLastSlice = dart.notNull(isLast) && start === end;
1797 if (start === dart.notNull(end) - 1 && dart.notNull(_isLeadSurrogate(str .codeUnitAt(start)))) {
1798 if (dart.notNull(isLast) && dart.notNull(this[_bufferIndex]) < dart.no tNull(this[_buffer].length) - 3) {
1799 let hasBeenCombined = this[_writeSurrogate](str.codeUnitAt(start), 0 );
1800 dart.assert(!dart.notNull(hasBeenCombined));
1801 } else {
1802 this[_carry] = str.codeUnitAt(start);
1803 }
1804 start = dart.notNull(start) + 1;
1805 }
1806 this[_sink].addSlice(this[_buffer], 0, this[_bufferIndex], isLastSlice);
1807 this[_bufferIndex] = 0;
1808 } while (dart.notNull(start) < dart.notNull(end));
1809 if (isLast)
1810 this.close();
1811 }
1812 }
1813 class Utf8Decoder extends Converter$(core.List$(core.int), core.String) {
1814 Utf8Decoder(opt$) {
1815 let allowMalformed = opt$.allowMalformed === void 0 ? false : opt$.allowMa lformed;
1816 this[_allowMalformed] = allowMalformed;
1817 super.Converter();
1818 }
1819 convert(codeUnits, start, end) {
1820 if (start === void 0)
1821 start = 0;
1822 if (end === void 0)
1823 end = null;
1824 let length = codeUnits.length;
1825 core.RangeError.checkValidRange(start, end, length);
1826 if (end === null)
1827 end = length;
1828 let buffer = new core.StringBuffer();
1829 let decoder = new _Utf8Decoder(buffer, this[_allowMalformed]);
1830 decoder.convert(codeUnits, start, end);
1831 decoder.close();
1832 return buffer.toString();
1833 }
1834 startChunkedConversion(sink) {
1835 let stringSink = null;
1836 if (dart.is(sink, StringConversionSink)) {
1837 stringSink = sink;
1838 } else {
1839 stringSink = new StringConversionSink.from(sink);
1840 }
1841 return stringSink.asUtf8Sink(this[_allowMalformed]);
1842 }
1843 bind(stream) {
1844 return dart.as(super.bind(stream), async.Stream$(core.String));
1845 }
1846 fuse(next) {
1847 return super.fuse(next);
1848 }
1849 }
1850 let _ONE_BYTE_LIMIT = 127;
1851 let _TWO_BYTE_LIMIT = 2047;
1852 let _THREE_BYTE_LIMIT = 65535;
1853 let _FOUR_BYTE_LIMIT = 1114111;
1854 let _SURROGATE_MASK = 63488;
1855 let _SURROGATE_TAG_MASK = 64512;
1856 let _SURROGATE_VALUE_MASK = 1023;
1857 let _LEAD_SURROGATE_MIN = 55296;
1858 let _TAIL_SURROGATE_MIN = 56320;
1859 // Function _isSurrogate: (int) → bool
1860 function _isSurrogate(codeUnit) {
1861 return (dart.notNull(codeUnit) & dart.notNull(_SURROGATE_MASK)) === _LEAD_SU RROGATE_MIN;
1862 }
1863 // Function _isLeadSurrogate: (int) → bool
1864 function _isLeadSurrogate(codeUnit) {
1865 return (dart.notNull(codeUnit) & dart.notNull(_SURROGATE_TAG_MASK)) === _LEA D_SURROGATE_MIN;
1866 }
1867 // Function _isTailSurrogate: (int) → bool
1868 function _isTailSurrogate(codeUnit) {
1869 return (dart.notNull(codeUnit) & dart.notNull(_SURROGATE_TAG_MASK)) === _TAI L_SURROGATE_MIN;
1870 }
1871 // Function _combineSurrogatePair: (int, int) → int
1872 function _combineSurrogatePair(lead, tail) {
1873 return 65536 + ((dart.notNull(lead) & dart.notNull(_SURROGATE_VALUE_MASK)) < < 10) | dart.notNull(tail) & dart.notNull(_SURROGATE_VALUE_MASK);
1874 }
1875 let _isFirstCharacter = Symbol('_isFirstCharacter');
1876 let _value = Symbol('_value');
1877 let _expectedUnits = Symbol('_expectedUnits');
1878 let _extraUnits = Symbol('_extraUnits');
1879 class _Utf8Decoder extends core.Object {
1880 _Utf8Decoder($_stringSink, $_allowMalformed) {
1881 this[_stringSink] = $_stringSink;
1882 this[_allowMalformed] = $_allowMalformed;
1883 this[_isFirstCharacter] = true;
1884 this[_value] = 0;
1885 this[_expectedUnits] = 0;
1886 this[_extraUnits] = 0;
1887 }
1888 get hasPartialInput() {
1889 return dart.notNull(this[_expectedUnits]) > 0;
1890 }
1891 close() {
1892 this.flush();
1893 }
1894 flush() {
1895 if (this.hasPartialInput) {
1896 if (!dart.notNull(this[_allowMalformed])) {
1897 throw new core.FormatException("Unfinished UTF-8 octet sequence");
1898 }
1899 this[_stringSink].writeCharCode(UNICODE_REPLACEMENT_CHARACTER_RUNE);
1900 this[_value] = 0;
1901 this[_expectedUnits] = 0;
1902 this[_extraUnits] = 0;
1903 }
1904 }
1905 convert(codeUnits, startIndex, endIndex) {
1906 let value = this[_value];
1907 let expectedUnits = this[_expectedUnits];
1908 let extraUnits = this[_extraUnits];
1909 this[_value] = 0;
1910 this[_expectedUnits] = 0;
1911 this[_extraUnits] = 0;
1912 // Function scanOneByteCharacters: (dynamic, int) → int
1913 function scanOneByteCharacters(units, from) {
1914 let to = endIndex;
1915 let mask = _ONE_BYTE_LIMIT;
1916 for (let i = from; dart.notNull(i) < dart.notNull(to); i = dart.notNull( i) + 1) {
1917 let unit = dart.dindex(units, i);
1918 if (!dart.equals(dart.dbinary(unit, '&', mask), unit))
1919 return dart.notNull(i) - dart.notNull(from);
1920 }
1921 return dart.notNull(to) - dart.notNull(from);
1922 }
1923 // Function addSingleBytes: (int, int) → void
1924 function addSingleBytes(from, to) {
1925 dart.assert(dart.notNull(from) >= dart.notNull(startIndex) && dart.notNu ll(from) <= dart.notNull(endIndex));
1926 dart.assert(dart.notNull(to) >= dart.notNull(startIndex) && dart.notNull (to) <= dart.notNull(endIndex));
1927 this[_stringSink].write(new core.String.fromCharCodes(codeUnits, from, t o));
1928 }
1929 let i = startIndex;
1930 loop:
1931 while (true) {
1932 multibyte:
1933 if (dart.notNull(expectedUnits) > 0) {
1934 do {
1935 if (i === endIndex) {
1936 break loop;
1937 }
1938 let unit = codeUnits.get(i);
1939 if ((dart.notNull(unit) & 192) !== 128) {
1940 expectedUnits = 0;
1941 if (!dart.notNull(this[_allowMalformed])) {
1942 throw new core.FormatException(`Bad UTF-8 encoding 0x${unit. toRadixString(16)}`);
1943 }
1944 this[_isFirstCharacter] = false;
1945 this[_stringSink].writeCharCode(UNICODE_REPLACEMENT_CHARACTER_ RUNE);
1946 break multibyte;
1947 } else {
1948 value = dart.notNull(value) << 6 | dart.notNull(unit) & 63;
1949 expectedUnits = dart.notNull(expectedUnits) - 1;
1950 i = dart.notNull(i) + 1;
1951 }
1952 } while (dart.notNull(expectedUnits) > 0);
1953 if (dart.notNull(value) <= dart.notNull(_Utf8Decoder._LIMITS.get(d art.notNull(extraUnits) - 1))) {
1954 if (!dart.notNull(this[_allowMalformed])) {
1955 throw new core.FormatException(`Overlong encoding of 0x${value .toRadixString(16)}`);
1956 }
1957 expectedUnits = extraUnits = 0;
1958 value = UNICODE_REPLACEMENT_CHARACTER_RUNE;
1959 }
1960 if (dart.notNull(value) > dart.notNull(_FOUR_BYTE_LIMIT)) {
1961 if (!dart.notNull(this[_allowMalformed])) {
1962 throw new core.FormatException("Character outside valid Unicod e range: " + `0x${value.toRadixString(16)}`);
1963 }
1964 value = UNICODE_REPLACEMENT_CHARACTER_RUNE;
1965 }
1966 if (!dart.notNull(this[_isFirstCharacter]) || value !== UNICODE_BO M_CHARACTER_RUNE) {
1967 this[_stringSink].writeCharCode(value);
1968 }
1969 this[_isFirstCharacter] = false;
1970 }
1971 while (dart.notNull(i) < dart.notNull(endIndex)) {
1972 let oneBytes = scanOneByteCharacters(codeUnits, i);
1973 if (dart.notNull(oneBytes) > 0) {
1974 this[_isFirstCharacter] = false;
1975 addSingleBytes(i, dart.notNull(i) + dart.notNull(oneBytes));
1976 i = oneBytes;
1977 if (i === endIndex)
1978 break;
1979 }
1980 let unit = codeUnits.get((($tmp) => i = dart.notNull($tmp) + 1, $tmp )(i));
1981 if (dart.notNull(unit) < 0) {
1982 if (!dart.notNull(this[_allowMalformed])) {
1983 throw new core.FormatException(`Negative UTF-8 code unit: -0x${( -dart.notNull(unit)).toRadixString(16)}`);
1984 }
1985 this[_stringSink].writeCharCode(UNICODE_REPLACEMENT_CHARACTER_RUNE );
1986 } else {
1987 dart.assert(dart.notNull(unit) > dart.notNull(_ONE_BYTE_LIMIT));
1988 if ((dart.notNull(unit) & 224) === 192) {
1989 value = dart.notNull(unit) & 31;
1990 expectedUnits = extraUnits = 1;
1991 continue loop;
1992 }
1993 if ((dart.notNull(unit) & 240) === 224) {
1994 value = dart.notNull(unit) & 15;
1995 expectedUnits = extraUnits = 2;
1996 continue loop;
1997 }
1998 if ((dart.notNull(unit) & 248) === 240 && dart.notNull(unit) < 245 ) {
1999 value = dart.notNull(unit) & 7;
2000 expectedUnits = extraUnits = 3;
2001 continue loop;
2002 }
2003 if (!dart.notNull(this[_allowMalformed])) {
2004 throw new core.FormatException(`Bad UTF-8 encoding 0x${unit.toRa dixString(16)}`);
2005 }
2006 value = UNICODE_REPLACEMENT_CHARACTER_RUNE;
2007 expectedUnits = extraUnits = 0;
2008 this[_isFirstCharacter] = false;
2009 this[_stringSink].writeCharCode(value);
2010 }
2011 }
2012 break loop;
2013 }
2014 if (dart.notNull(expectedUnits) > 0) {
2015 this[_value] = value;
2016 this[_expectedUnits] = expectedUnits;
2017 this[_extraUnits] = extraUnits;
2018 }
2019 }
2020 }
2021 _Utf8Decoder._LIMITS = /* Unimplemented const */new List.from([_ONE_BYTE_LIMIT , _TWO_BYTE_LIMIT, _THREE_BYTE_LIMIT, _FOUR_BYTE_LIMIT]);
2022 let _processed = Symbol('_processed');
2023 let _original = Symbol('_original');
2024 // Function _convertJsonToDart: (dynamic, (dynamic, dynamic) → dynamic) → dyna mic
2025 function _convertJsonToDart(json, reviver) {
2026 dart.assert(reviver !== null);
2027 // Function walk: (dynamic) → dynamic
2028 function walk(e) {
2029 if (e == null || typeof e != "object") {
2030 return e;
2031 }
2032 if (Object.getPrototypeOf(e) === Array.prototype) {
2033 for (let i = 0; dart.notNull(i) < e.length; i = dart.notNull(i) + 1) {
2034 let item = e[i];
2035 e[i] = dart.dinvokef(reviver, i, walk(item));
2036 }
2037 return e;
2038 }
2039 let map = new _JsonMap(e);
2040 let processed = map[_processed];
2041 let keys = map._computeKeys();
2042 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); i = dart.notN ull(i) + 1) {
2043 let key = keys.get(i);
2044 let revived = dart.dinvokef(reviver, key, walk(e[key]));
2045 processed[key] = revived;
2046 }
2047 map[_original] = processed;
2048 return map;
2049 }
2050 return dart.dinvokef(reviver, null, walk(json));
2051 }
2052 // Function _convertJsonToDartLazy: (dynamic) → dynamic
2053 function _convertJsonToDartLazy(object) {
2054 if (object === null)
2055 return null;
2056 if (typeof object != "object") {
2057 return object;
2058 }
2059 if (Object.getPrototypeOf(object) !== Array.prototype) {
2060 return new _JsonMap(object);
2061 }
2062 for (let i = 0; dart.notNull(i) < object.length; i = dart.notNull(i) + 1) {
2063 let item = object[i];
2064 object[i] = _convertJsonToDartLazy(item);
2065 }
2066 return object;
2067 }
2068 let _data = Symbol('_data');
2069 let _isUpgraded = Symbol('_isUpgraded');
2070 let _upgradedMap = Symbol('_upgradedMap');
2071 let _process = Symbol('_process');
2072 let _computeKeys = Symbol('_computeKeys');
2073 let _upgrade = Symbol('_upgrade');
2074 let _hasProperty = Symbol('_hasProperty');
2075 let _getProperty = Symbol('_getProperty');
2076 let _setProperty = Symbol('_setProperty');
2077 let _getPropertyNames = Symbol('_getPropertyNames');
2078 let _isUnprocessed = Symbol('_isUnprocessed');
2079 let _newJavaScriptObject = Symbol('_newJavaScriptObject');
2080 class _JsonMap extends core.Object {
2081 _JsonMap($_original) {
2082 this[_processed] = _newJavaScriptObject();
2083 this[_original] = $_original;
2084 this[_data] = null;
2085 }
2086 get(key) {
2087 if (this[_isUpgraded]) {
2088 return this[_upgradedMap].get(key);
2089 } else if (!(typeof key == string)) {
2090 return null;
2091 } else {
2092 let result = _getProperty(this[_processed], dart.as(key, core.String));
2093 if (_isUnprocessed(result))
2094 result = this[_process](dart.as(key, core.String));
2095 return result;
2096 }
2097 }
2098 get length() {
2099 return this[_isUpgraded] ? this[_upgradedMap].length : this[_computeKeys]( ).length;
2100 }
2101 get isEmpty() {
2102 return this.length === 0;
2103 }
2104 get isNotEmpty() {
2105 return dart.notNull(this.length) > 0;
2106 }
2107 get keys() {
2108 if (this[_isUpgraded])
2109 return this[_upgradedMap].keys;
2110 return new _JsonMapKeyIterable(this);
2111 }
2112 get values() {
2113 if (this[_isUpgraded])
2114 return this[_upgradedMap].values;
2115 return new _internal.MappedIterable(this[_computeKeys](), ((each) => this. get(each)).bind(this));
2116 }
2117 set(key, value) {
2118 if (this[_isUpgraded]) {
2119 this[_upgradedMap].set(key, value);
2120 } else if (this.containsKey(key)) {
2121 let processed = this[_processed];
2122 _setProperty(processed, dart.as(key, core.String), value);
2123 let original = this[_original];
2124 if (!dart.notNull(core.identical(original, processed))) {
2125 _setProperty(original, dart.as(key, core.String), null);
2126 }
2127 } else {
2128 this[_upgrade]().set(key, value);
2129 }
2130 }
2131 addAll(other) {
2132 other.forEach(((key, value) => {
2133 this.set(key, value);
2134 }).bind(this));
2135 }
2136 containsValue(value) {
2137 if (this[_isUpgraded])
2138 return this[_upgradedMap].containsValue(value);
2139 let keys = this[_computeKeys]();
2140 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); i = dart.notN ull(i) + 1) {
2141 let key = keys.get(i);
2142 if (dart.equals(this.get(key), value))
2143 return true;
2144 }
2145 return false;
2146 }
2147 containsKey(key) {
2148 if (this[_isUpgraded])
2149 return this[_upgradedMap].containsKey(key);
2150 if (!(typeof key == string))
2151 return false;
2152 return _hasProperty(this[_original], dart.as(key, core.String));
2153 }
2154 putIfAbsent(key, ifAbsent) {
2155 if (this.containsKey(key))
2156 return this.get(key);
2157 let value = ifAbsent();
2158 this.set(key, value);
2159 return value;
2160 }
2161 remove(key) {
2162 if (!dart.notNull(this[_isUpgraded]) && !dart.notNull(this.containsKey(key )))
2163 return null;
2164 return this[_upgrade]().remove(key);
2165 }
2166 clear() {
2167 if (this[_isUpgraded]) {
2168 this[_upgradedMap].clear();
2169 } else {
2170 if (this[_data] !== null) {
2171 dart.dinvoke(this[_data], 'clear');
2172 }
2173 this[_original] = this[_processed] = null;
2174 this[_data] = dart.map();
2175 }
2176 }
2177 forEach(f) {
2178 if (this[_isUpgraded])
2179 return this[_upgradedMap].forEach(f);
2180 let keys = this[_computeKeys]();
2181 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); i = dart.notN ull(i) + 1) {
2182 let key = keys.get(i);
2183 let value = _getProperty(this[_processed], key);
2184 if (_isUnprocessed(value)) {
2185 value = _convertJsonToDartLazy(_getProperty(this[_original], key));
2186 _setProperty(this[_processed], key, value);
2187 }
2188 dart.dinvokef(f, key, value);
2189 if (!dart.notNull(core.identical(keys, this[_data]))) {
2190 throw new core.ConcurrentModificationError(this);
2191 }
2192 }
2193 }
2194 toString() {
2195 return collection.Maps.mapToString(this);
2196 }
2197 get [_isUpgraded]() {
2198 return this[_processed] === null;
2199 }
2200 get [_upgradedMap]() {
2201 dart.assert(this[_isUpgraded]);
2202 return dart.as(this[_data], core.Map);
2203 }
2204 [_computeKeys]() {
2205 dart.assert(!dart.notNull(this[_isUpgraded]));
2206 let keys = dart.as(this[_data], core.List);
2207 if (keys === null) {
2208 keys = this[_data] = _getPropertyNames(this[_original]);
2209 }
2210 return dart.as(keys, core.List$(core.String));
2211 }
2212 [_upgrade]() {
2213 if (this[_isUpgraded])
2214 return this[_upgradedMap];
2215 let result = dart.map();
2216 let keys = this[_computeKeys]();
2217 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); i = dart.notN ull(i) + 1) {
2218 let key = keys.get(i);
2219 result.set(key, this.get(key));
2220 }
2221 if (keys.isEmpty) {
2222 keys.add(null);
2223 } else {
2224 keys.clear();
2225 }
2226 this[_original] = this[_processed] = null;
2227 this[_data] = result;
2228 dart.assert(this[_isUpgraded]);
2229 return result;
2230 }
2231 [_process](key) {
2232 if (!dart.notNull(_hasProperty(this[_original], key)))
2233 return null;
2234 let result = _convertJsonToDartLazy(_getProperty(this[_original], key));
2235 return _setProperty(this[_processed], key, result);
2236 }
2237 static [_hasProperty](object, key) {
2238 return Object.prototype.hasOwnProperty.call(object, key);
2239 }
2240 static [_getProperty](object, key) {
2241 return object[key];
2242 }
2243 static [_setProperty](object, key, value) {
2244 return object[key] = value;
2245 }
2246 static [_getPropertyNames](object) {
2247 return dart.as(Object.keys(object), core.List);
2248 }
2249 static [_isUnprocessed](object) {
2250 return typeof object == "undefined";
2251 }
2252 static [_newJavaScriptObject]() {
2253 return Object.create(null);
2254 }
2255 }
2256 let _parent = Symbol('_parent');
2257 class _JsonMapKeyIterable extends _internal.ListIterable {
2258 _JsonMapKeyIterable($_parent) {
2259 this[_parent] = $_parent;
2260 super.ListIterable();
2261 }
2262 get length() {
2263 return this[_parent].length;
2264 }
2265 elementAt(index) {
2266 return dart.as(this[_parent][_isUpgraded] ? this[_parent].keys.elementAt(i ndex) : this[_parent]._computeKeys().get(index), core.String);
2267 }
2268 get iterator() {
2269 return dart.as(this[_parent][_isUpgraded] ? this[_parent].keys.iterator : this[_parent]._computeKeys().iterator, core.Iterator);
2270 }
2271 contains(key) {
2272 return this[_parent].containsKey(key);
2273 }
2274 }
2275 class _JsonDecoderSink extends _StringSinkConversionSink {
2276 _JsonDecoderSink($_reviver, $_sink) {
2277 this[_reviver] = $_reviver;
2278 this[_sink] = $_sink;
2279 super._StringSinkConversionSink(new core.StringBuffer());
2280 }
2281 close() {
2282 super.close();
2283 let buffer = dart.as(this[_stringSink], core.StringBuffer);
2284 let accumulated = buffer.toString();
2285 buffer.clear();
2286 let decoded = _parseJson(accumulated, this[_reviver]);
2287 this[_sink].add(decoded);
2288 this[_sink].close();
2289 }
2290 }
2291 // Exports:
2292 exports.ASCII = ASCII;
2293 exports.AsciiCodec = AsciiCodec;
2294 exports.Encoding = Encoding;
2295 exports.Codec = Codec;
2296 exports.Codec$ = Codec$;
2297 exports.Converter = Converter;
2298 exports.Converter$ = Converter$;
2299 exports.AsciiEncoder = AsciiEncoder;
2300 exports.StringConversionSinkBase = StringConversionSinkBase;
2301 exports.StringConversionSinkMixin = StringConversionSinkMixin;
2302 exports.AsciiDecoder = AsciiDecoder;
2303 exports.ByteConversionSinkBase = ByteConversionSinkBase;
2304 exports.ByteConversionSink = ByteConversionSink;
2305 exports.ChunkedConversionSink = ChunkedConversionSink;
2306 exports.ChunkedConversionSink$ = ChunkedConversionSink$;
2307 exports.HTML_ESCAPE = HTML_ESCAPE;
2308 exports.HtmlEscapeMode = HtmlEscapeMode;
2309 exports.HtmlEscape = HtmlEscape;
2310 exports.JsonUnsupportedObjectError = JsonUnsupportedObjectError;
2311 exports.JsonCyclicError = JsonCyclicError;
2312 exports.JSON = JSON;
2313 exports.JsonCodec = JsonCodec;
2314 exports.JsonEncoder = JsonEncoder;
2315 exports.JsonUtf8Encoder = JsonUtf8Encoder;
2316 exports.JsonDecoder = JsonDecoder;
2317 exports.LATIN1 = LATIN1;
2318 exports.Latin1Codec = Latin1Codec;
2319 exports.Latin1Encoder = Latin1Encoder;
2320 exports.Latin1Decoder = Latin1Decoder;
2321 exports.LineSplitter = LineSplitter;
2322 exports.StringConversionSink = StringConversionSink;
2323 exports.ClosableStringSink = ClosableStringSink;
2324 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN E;
2325 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE;
2326 exports.UTF8 = UTF8;
2327 exports.Utf8Codec = Utf8Codec;
2328 exports.Utf8Encoder = Utf8Encoder;
2329 exports.Utf8Decoder = Utf8Decoder;
2330 })(convert || (convert = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/dart/collection.js ('k') | test/codegen/expect/dart/core.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698