| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 decodeStream(byteStream) { | 47 decodeStream(byteStream) { |
| 48 return byteStream.transform(this.decoder).fold(new core.StringBuffer(), da
rt.fn((buffer, string) => ((() => { | 48 return byteStream.transform(this.decoder).fold(new core.StringBuffer(), da
rt.fn((buffer, string) => ((() => { |
| 49 dart.dsend(buffer, 'write', string); | 49 dart.dsend(buffer, 'write', string); |
| 50 return buffer; | 50 return buffer; |
| 51 })()))).then(dart.fn(buffer => dart.toString(buffer), core.String, [dart.d
ynamic])); | 51 })()))).then(dart.fn(buffer => dart.toString(buffer), core.String, [dart.d
ynamic])); |
| 52 } | 52 } |
| 53 static getByName(name) { | 53 static getByName(name) { |
| 54 if (name == null) return null; | 54 if (name == null) return null; |
| 55 name = name[dartx.toLowerCase](); | 55 name = name[dartx.toLowerCase](); |
| 56 return Encoding._nameToEncoding.get(name); | 56 return Encoding._nameToEncoding[dartx.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, { | 65 dart.defineLazyProperties(Encoding, { |
| 66 get _nameToEncoding() { | 66 get _nameToEncoding() { |
| (...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 for (let i = 1; i < dart.notNull(list[dartx.length]); i++) { | 1211 for (let i = 1; i < dart.notNull(list[dartx.length]); i++) { |
| 1212 this.writeString(','); | 1212 this.writeString(','); |
| 1213 this.writeObject(list[dartx.get](i)); | 1213 this.writeObject(list[dartx.get](i)); |
| 1214 } | 1214 } |
| 1215 } | 1215 } |
| 1216 this.writeString(']'); | 1216 this.writeString(']'); |
| 1217 } | 1217 } |
| 1218 writeMap(map) { | 1218 writeMap(map) { |
| 1219 this.writeString('{'); | 1219 this.writeString('{'); |
| 1220 let separator = '"'; | 1220 let separator = '"'; |
| 1221 map.forEach(dart.fn((key, value) => { | 1221 map[dartx.forEach](dart.fn((key, value) => { |
| 1222 this.writeString(separator); | 1222 this.writeString(separator); |
| 1223 separator = ',"'; | 1223 separator = ',"'; |
| 1224 this.writeStringContent(key); | 1224 this.writeStringContent(key); |
| 1225 this.writeString('":'); | 1225 this.writeString('":'); |
| 1226 this.writeObject(value); | 1226 this.writeObject(value); |
| 1227 }, dart.void, [core.String, core.Object])); | 1227 }, dart.void, [core.String, core.Object])); |
| 1228 this.writeString('}'); | 1228 this.writeString('}'); |
| 1229 } | 1229 } |
| 1230 } | 1230 } |
| 1231 dart.setSignature(_JsonStringifier, { | 1231 dart.setSignature(_JsonStringifier, { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 this.writeIndentation(this[_indentLevel]); | 1274 this.writeIndentation(this[_indentLevel]); |
| 1275 this.writeObject(list[dartx.get](i)); | 1275 this.writeObject(list[dartx.get](i)); |
| 1276 } | 1276 } |
| 1277 this.writeString('\n'); | 1277 this.writeString('\n'); |
| 1278 this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1; | 1278 this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1; |
| 1279 this.writeIndentation(this[_indentLevel]); | 1279 this.writeIndentation(this[_indentLevel]); |
| 1280 this.writeString(']'); | 1280 this.writeString(']'); |
| 1281 } | 1281 } |
| 1282 } | 1282 } |
| 1283 writeMap(map) { | 1283 writeMap(map) { |
| 1284 if (dart.notNull(map.isEmpty)) { | 1284 if (dart.notNull(map[dartx.isEmpty])) { |
| 1285 this.writeString('{}'); | 1285 this.writeString('{}'); |
| 1286 } else { | 1286 } else { |
| 1287 this.writeString('{\n'); | 1287 this.writeString('{\n'); |
| 1288 this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1; | 1288 this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1; |
| 1289 let first = true; | 1289 let first = true; |
| 1290 map.forEach(dart.fn((key, value) => { | 1290 map[dartx.forEach](dart.fn((key, value) => { |
| 1291 if (!first) { | 1291 if (!first) { |
| 1292 this.writeString(",\n"); | 1292 this.writeString(",\n"); |
| 1293 } | 1293 } |
| 1294 this.writeIndentation(this[_indentLevel]); | 1294 this.writeIndentation(this[_indentLevel]); |
| 1295 this.writeString('"'); | 1295 this.writeString('"'); |
| 1296 this.writeStringContent(key); | 1296 this.writeStringContent(key); |
| 1297 this.writeString('": '); | 1297 this.writeString('": '); |
| 1298 this.writeObject(value); | 1298 this.writeObject(value); |
| 1299 first = false; | 1299 first = false; |
| 1300 }, dart.void, [core.String, core.Object])); | 1300 }, dart.void, [core.String, core.Object])); |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2545 const _process = Symbol('_process'); | 2545 const _process = Symbol('_process'); |
| 2546 const _upgrade = Symbol('_upgrade'); | 2546 const _upgrade = Symbol('_upgrade'); |
| 2547 class _JsonMap extends core.Object { | 2547 class _JsonMap extends core.Object { |
| 2548 _JsonMap(original) { | 2548 _JsonMap(original) { |
| 2549 this[_processed] = _JsonMap._newJavaScriptObject(); | 2549 this[_processed] = _JsonMap._newJavaScriptObject(); |
| 2550 this[_original] = original; | 2550 this[_original] = original; |
| 2551 this[_data] = null; | 2551 this[_data] = null; |
| 2552 } | 2552 } |
| 2553 get(key) { | 2553 get(key) { |
| 2554 if (dart.notNull(this[_isUpgraded])) { | 2554 if (dart.notNull(this[_isUpgraded])) { |
| 2555 return this[_upgradedMap].get(key); | 2555 return this[_upgradedMap][dartx.get](key); |
| 2556 } else if (!(typeof key == 'string')) { | 2556 } else if (!(typeof key == 'string')) { |
| 2557 return null; | 2557 return null; |
| 2558 } else { | 2558 } else { |
| 2559 let result = _JsonMap._getProperty(this[_processed], dart.as(key, core.S
tring)); | 2559 let result = _JsonMap._getProperty(this[_processed], dart.as(key, core.S
tring)); |
| 2560 if (dart.notNull(_JsonMap._isUnprocessed(result))) result = this[_proces
s](dart.as(key, core.String)); | 2560 if (dart.notNull(_JsonMap._isUnprocessed(result))) result = this[_proces
s](dart.as(key, core.String)); |
| 2561 return result; | 2561 return result; |
| 2562 } | 2562 } |
| 2563 } | 2563 } |
| 2564 get length() { | 2564 get length() { |
| 2565 return dart.notNull(this[_isUpgraded]) ? this[_upgradedMap].length : this[
_computeKeys]()[dartx.length]; | 2565 return dart.notNull(this[_isUpgraded]) ? this[_upgradedMap][dartx.length]
: this[_computeKeys]()[dartx.length]; |
| 2566 } | 2566 } |
| 2567 get isEmpty() { | 2567 get isEmpty() { |
| 2568 return this.length == 0; | 2568 return this.length == 0; |
| 2569 } | 2569 } |
| 2570 get isNotEmpty() { | 2570 get isNotEmpty() { |
| 2571 return dart.notNull(this.length) > 0; | 2571 return dart.notNull(this.length) > 0; |
| 2572 } | 2572 } |
| 2573 get keys() { | 2573 get keys() { |
| 2574 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap].keys; | 2574 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap][dartx.keys]
; |
| 2575 return new _JsonMapKeyIterable(this); | 2575 return new _JsonMapKeyIterable(this); |
| 2576 } | 2576 } |
| 2577 get values() { | 2577 get values() { |
| 2578 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap].values; | 2578 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap][dartx.value
s]; |
| 2579 return _internal.MappedIterable.new(this[_computeKeys](), dart.fn(each =>
this.get(each))); | 2579 return _internal.MappedIterable.new(this[_computeKeys](), dart.fn(each =>
this.get(each))); |
| 2580 } | 2580 } |
| 2581 set(key, value) { | 2581 set(key, value) { |
| 2582 if (dart.notNull(this[_isUpgraded])) { | 2582 if (dart.notNull(this[_isUpgraded])) { |
| 2583 this[_upgradedMap].set(key, value); | 2583 this[_upgradedMap][dartx.set](key, value); |
| 2584 } else if (dart.notNull(this.containsKey(key))) { | 2584 } else if (dart.notNull(this.containsKey(key))) { |
| 2585 let processed = this[_processed]; | 2585 let processed = this[_processed]; |
| 2586 _JsonMap._setProperty(processed, dart.as(key, core.String), value); | 2586 _JsonMap._setProperty(processed, dart.as(key, core.String), value); |
| 2587 let original = this[_original]; | 2587 let original = this[_original]; |
| 2588 if (!dart.notNull(core.identical(original, processed))) { | 2588 if (!dart.notNull(core.identical(original, processed))) { |
| 2589 _JsonMap._setProperty(original, dart.as(key, core.String), null); | 2589 _JsonMap._setProperty(original, dart.as(key, core.String), null); |
| 2590 } | 2590 } |
| 2591 } else { | 2591 } else { |
| 2592 this[_upgrade]().set(key, value); | 2592 this[_upgrade]()[dartx.set](key, value); |
| 2593 } | 2593 } |
| 2594 return value; | 2594 return value; |
| 2595 } | 2595 } |
| 2596 addAll(other) { | 2596 addAll(other) { |
| 2597 other.forEach(dart.fn((key, value) => { | 2597 other[dartx.forEach](dart.fn((key, value) => { |
| 2598 this.set(key, value); | 2598 this.set(key, value); |
| 2599 }, dart.void, [dart.dynamic, dart.dynamic])); | 2599 }, dart.void, [dart.dynamic, dart.dynamic])); |
| 2600 } | 2600 } |
| 2601 containsValue(value) { | 2601 containsValue(value) { |
| 2602 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap].containsVal
ue(value); | 2602 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap][dartx.conta
insValue](value); |
| 2603 let keys = this[_computeKeys](); | 2603 let keys = this[_computeKeys](); |
| 2604 for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) { | 2604 for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) { |
| 2605 let key = keys[dartx.get](i); | 2605 let key = keys[dartx.get](i); |
| 2606 if (dart.equals(this.get(key), value)) return true; | 2606 if (dart.equals(this.get(key), value)) return true; |
| 2607 } | 2607 } |
| 2608 return false; | 2608 return false; |
| 2609 } | 2609 } |
| 2610 containsKey(key) { | 2610 containsKey(key) { |
| 2611 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap].containsKey
(key); | 2611 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap][dartx.conta
insKey](key); |
| 2612 if (!(typeof key == 'string')) return false; | 2612 if (!(typeof key == 'string')) return false; |
| 2613 return _JsonMap._hasProperty(this[_original], dart.as(key, core.String)); | 2613 return _JsonMap._hasProperty(this[_original], dart.as(key, core.String)); |
| 2614 } | 2614 } |
| 2615 putIfAbsent(key, ifAbsent) { | 2615 putIfAbsent(key, ifAbsent) { |
| 2616 if (dart.notNull(this.containsKey(key))) return this.get(key); | 2616 if (dart.notNull(this.containsKey(key))) return this.get(key); |
| 2617 let value = ifAbsent(); | 2617 let value = ifAbsent(); |
| 2618 this.set(key, value); | 2618 this.set(key, value); |
| 2619 return value; | 2619 return value; |
| 2620 } | 2620 } |
| 2621 remove(key) { | 2621 remove(key) { |
| 2622 if (!dart.notNull(this[_isUpgraded]) && !dart.notNull(this.containsKey(key
))) return null; | 2622 if (!dart.notNull(this[_isUpgraded]) && !dart.notNull(this.containsKey(key
))) return null; |
| 2623 return this[_upgrade]().remove(key); | 2623 return this[_upgrade]()[dartx.remove](key); |
| 2624 } | 2624 } |
| 2625 clear() { | 2625 clear() { |
| 2626 if (dart.notNull(this[_isUpgraded])) { | 2626 if (dart.notNull(this[_isUpgraded])) { |
| 2627 this[_upgradedMap].clear(); | 2627 this[_upgradedMap][dartx.clear](); |
| 2628 } else { | 2628 } else { |
| 2629 if (this[_data] != null) { | 2629 if (this[_data] != null) { |
| 2630 dart.dsend(this[_data], 'clear'); | 2630 dart.dsend(this[_data], 'clear'); |
| 2631 } | 2631 } |
| 2632 this[_original] = this[_processed] = null; | 2632 this[_original] = this[_processed] = null; |
| 2633 this[_data] = dart.map(); | 2633 this[_data] = dart.map(); |
| 2634 } | 2634 } |
| 2635 } | 2635 } |
| 2636 forEach(f) { | 2636 forEach(f) { |
| 2637 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap].forEach(f); | 2637 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap][dartx.forEa
ch](f); |
| 2638 let keys = this[_computeKeys](); | 2638 let keys = this[_computeKeys](); |
| 2639 for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) { | 2639 for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) { |
| 2640 let key = keys[dartx.get](i); | 2640 let key = keys[dartx.get](i); |
| 2641 let value = _JsonMap._getProperty(this[_processed], key); | 2641 let value = _JsonMap._getProperty(this[_processed], key); |
| 2642 if (dart.notNull(_JsonMap._isUnprocessed(value))) { | 2642 if (dart.notNull(_JsonMap._isUnprocessed(value))) { |
| 2643 value = _convertJsonToDartLazy(_JsonMap._getProperty(this[_original],
key)); | 2643 value = _convertJsonToDartLazy(_JsonMap._getProperty(this[_original],
key)); |
| 2644 _JsonMap._setProperty(this[_processed], key, value); | 2644 _JsonMap._setProperty(this[_processed], key, value); |
| 2645 } | 2645 } |
| 2646 dart.dcall(f, key, value); | 2646 dart.dcall(f, key, value); |
| 2647 if (!dart.notNull(core.identical(keys, this[_data]))) { | 2647 if (!dart.notNull(core.identical(keys, this[_data]))) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2666 keys = this[_data] = _JsonMap._getPropertyNames(this[_original]); | 2666 keys = this[_data] = _JsonMap._getPropertyNames(this[_original]); |
| 2667 } | 2667 } |
| 2668 return dart.as(keys, core.List$(core.String)); | 2668 return dart.as(keys, core.List$(core.String)); |
| 2669 } | 2669 } |
| 2670 [_upgrade]() { | 2670 [_upgrade]() { |
| 2671 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap]; | 2671 if (dart.notNull(this[_isUpgraded])) return this[_upgradedMap]; |
| 2672 let result = dart.map(); | 2672 let result = dart.map(); |
| 2673 let keys = this[_computeKeys](); | 2673 let keys = this[_computeKeys](); |
| 2674 for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) { | 2674 for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) { |
| 2675 let key = keys[dartx.get](i); | 2675 let key = keys[dartx.get](i); |
| 2676 result.set(key, this.get(key)); | 2676 result[dartx.set](key, this.get(key)); |
| 2677 } | 2677 } |
| 2678 if (dart.notNull(keys[dartx.isEmpty])) { | 2678 if (dart.notNull(keys[dartx.isEmpty])) { |
| 2679 keys[dartx.add](null); | 2679 keys[dartx.add](null); |
| 2680 } else { | 2680 } else { |
| 2681 keys[dartx.clear](); | 2681 keys[dartx.clear](); |
| 2682 } | 2682 } |
| 2683 this[_original] = this[_processed] = null; | 2683 this[_original] = this[_processed] = null; |
| 2684 this[_data] = result; | 2684 this[_data] = result; |
| 2685 dart.assert(this[_isUpgraded]); | 2685 dart.assert(this[_isUpgraded]); |
| 2686 return result; | 2686 return result; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 statics: () => ({ | 2729 statics: () => ({ |
| 2730 _hasProperty: [core.bool, [dart.dynamic, core.String]], | 2730 _hasProperty: [core.bool, [dart.dynamic, core.String]], |
| 2731 _getProperty: [dart.dynamic, [dart.dynamic, core.String]], | 2731 _getProperty: [dart.dynamic, [dart.dynamic, core.String]], |
| 2732 _setProperty: [dart.dynamic, [dart.dynamic, core.String, dart.dynamic]], | 2732 _setProperty: [dart.dynamic, [dart.dynamic, core.String, dart.dynamic]], |
| 2733 _getPropertyNames: [core.List, [dart.dynamic]], | 2733 _getPropertyNames: [core.List, [dart.dynamic]], |
| 2734 _isUnprocessed: [core.bool, [dart.dynamic]], | 2734 _isUnprocessed: [core.bool, [dart.dynamic]], |
| 2735 _newJavaScriptObject: [dart.dynamic, []] | 2735 _newJavaScriptObject: [dart.dynamic, []] |
| 2736 }), | 2736 }), |
| 2737 names: ['_hasProperty', '_getProperty', '_setProperty', '_getPropertyNames',
'_isUnprocessed', '_newJavaScriptObject'] | 2737 names: ['_hasProperty', '_getProperty', '_setProperty', '_getPropertyNames',
'_isUnprocessed', '_newJavaScriptObject'] |
| 2738 }); | 2738 }); |
| 2739 dart.defineExtensionMembers(_JsonMap, [ |
| 2740 'get', |
| 2741 'set', |
| 2742 'addAll', |
| 2743 'containsValue', |
| 2744 'containsKey', |
| 2745 'putIfAbsent', |
| 2746 'remove', |
| 2747 'clear', |
| 2748 'forEach', |
| 2749 'length', |
| 2750 'isEmpty', |
| 2751 'isNotEmpty', |
| 2752 'keys', |
| 2753 'values' |
| 2754 ]); |
| 2739 const _parent = Symbol('_parent'); | 2755 const _parent = Symbol('_parent'); |
| 2740 class _JsonMapKeyIterable extends _internal.ListIterable { | 2756 class _JsonMapKeyIterable extends _internal.ListIterable { |
| 2741 _JsonMapKeyIterable(parent) { | 2757 _JsonMapKeyIterable(parent) { |
| 2742 this[_parent] = parent; | 2758 this[_parent] = parent; |
| 2743 super.ListIterable(); | 2759 super.ListIterable(); |
| 2744 } | 2760 } |
| 2745 get length() { | 2761 get length() { |
| 2746 return this[_parent].length; | 2762 return this[_parent].length; |
| 2747 } | 2763 } |
| 2748 elementAt(index) { | 2764 elementAt(index) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2812 exports.LineSplitter = LineSplitter; | 2828 exports.LineSplitter = LineSplitter; |
| 2813 exports.StringConversionSink = StringConversionSink; | 2829 exports.StringConversionSink = StringConversionSink; |
| 2814 exports.ClosableStringSink = ClosableStringSink; | 2830 exports.ClosableStringSink = ClosableStringSink; |
| 2815 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN
E; | 2831 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN
E; |
| 2816 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE; | 2832 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE; |
| 2817 exports.Utf8Codec = Utf8Codec; | 2833 exports.Utf8Codec = Utf8Codec; |
| 2818 exports.UTF8 = UTF8; | 2834 exports.UTF8 = UTF8; |
| 2819 exports.Utf8Encoder = Utf8Encoder; | 2835 exports.Utf8Encoder = Utf8Encoder; |
| 2820 exports.Utf8Decoder = Utf8Decoder; | 2836 exports.Utf8Decoder = Utf8Decoder; |
| 2821 }); | 2837 }); |
| OLD | NEW |