| Index: test/dart_codegen/expect/convert/json.dart
|
| diff --git a/test/dart_codegen/expect/convert/json.dart b/test/dart_codegen/expect/convert/json.dart
|
| index 3e30c1658cbd3b406d65d12ea26f3bf37c1536ae..8bab5e2019f0f8224f3e3be3a39fd106dc83f4ae 100644
|
| --- a/test/dart_codegen/expect/convert/json.dart
|
| +++ b/test/dart_codegen/expect/convert/json.dart
|
| @@ -37,11 +37,19 @@ toEncodable(var object)}
|
| ) {
|
| if (toEncodable == null) toEncodable = _toEncodable;
|
| if (toEncodable == null) return encoder.convert(value);
|
| - return new JsonEncoder(toEncodable).convert(value);
|
| + return new JsonEncoder(DDC$RT.wrap((dynamic f(dynamic __u7)) {
|
| +dynamic c(dynamic x0) => f(x0);
|
| + return f == null ? null : c;
|
| +}
|
| +, toEncodable, __t10, __t8, "Wrap", """line 142, column 28 of dart:convert/json.dart: """, toEncodable is __t8)).convert(value);
|
| }
|
| JsonEncoder get encoder {
|
| if (_toEncodable == null) return const JsonEncoder();
|
| - return new JsonEncoder(_toEncodable);
|
| + return new JsonEncoder(DDC$RT.wrap((dynamic f(dynamic __u12)) {
|
| +dynamic c(dynamic x0) => f(x0);
|
| + return f == null ? null : c;
|
| +}
|
| +, _toEncodable, __t10, __t8, "Wrap", """line 147, column 28 of dart:convert/json.dart: """, _toEncodable is __t8));
|
| }
|
| JsonDecoder get decoder {
|
| if (_reviver == null) return const JsonDecoder();
|
| @@ -52,7 +60,7 @@ if (_reviver == null) return const JsonDecoder();
|
| final Function _toEncodable;
|
| const JsonEncoder([Object toEncodable(Object nonSerializable)]) : this.indent = null, this._toEncodable = toEncodable;
|
| const JsonEncoder.withIndent(this.indent, [Object toEncodable(Object nonSerializable)]) : this._toEncodable = toEncodable;
|
| - String convert(Object object) => _JsonStringStringifier.stringify(object, DDC$RT.cast(_toEncodable, Function, __t7, "CastGeneral", """line 243, column 48 of dart:convert/json.dart: """, _toEncodable is __t7, false), indent);
|
| + String convert(Object object) => _JsonStringStringifier.stringify(object, DDC$RT.cast(_toEncodable, Function, __t10, "CastGeneral", """line 243, column 48 of dart:convert/json.dart: """, _toEncodable is __t10, false), indent);
|
| ChunkedConversionSink<Object> startChunkedConversion(Sink<String> sink) {
|
| if (sink is! StringConversionSink) {
|
| sink = new StringConversionSink.from(sink);
|
| @@ -60,16 +68,18 @@ sink = new StringConversionSink.from(sink);
|
| else if (sink is _Utf8EncoderSink) {
|
| return new _JsonUtf8EncoderSink(sink._sink, _toEncodable, JsonUtf8Encoder._utf8Encode(indent), JsonUtf8Encoder.DEFAULT_BUFFER_SIZE);
|
| }
|
| - return new _JsonEncoderSink(sink, _toEncodable, indent);
|
| + return new _JsonEncoderSink(DDC$RT.cast(sink, DDC$RT.type((Sink<String> _) {
|
| +}
|
| +), StringConversionSink, "CastGeneral", """line 262, column 33 of dart:convert/json.dart: """, sink is StringConversionSink, true), _toEncodable, indent);
|
| }
|
| - Stream<String> bind(Stream<Object> stream) => ((__x9) => DDC$RT.cast(__x9, DDC$RT.type((DDC$async$.Stream<dynamic> _) {
|
| + Stream<String> bind(Stream<Object> stream) => ((__x13) => DDC$RT.cast(__x13, DDC$RT.type((DDC$async$.Stream<dynamic> _) {
|
| }
|
| ), DDC$RT.type((DDC$async$.Stream<String> _) {
|
| }
|
| -), "CastDynamic", """line 266, column 49 of dart:convert/json.dart: """, __x9 is DDC$async$.Stream<String>, false))(super.bind(stream));
|
| +), "CastDynamic", """line 266, column 49 of dart:convert/json.dart: """, __x13 is DDC$async$.Stream<String>, false))(super.bind(stream));
|
| Converter<Object, dynamic> fuse(Converter<String, dynamic> other) {
|
| if (other is Utf8Encoder) {
|
| -return new JsonUtf8Encoder(indent, _toEncodable);
|
| +return new JsonUtf8Encoder(indent, DDC$RT.cast(_toEncodable, Function, __t14, "CastGeneral", """line 270, column 42 of dart:convert/json.dart: """, _toEncodable is __t14, false));
|
| }
|
| return super.fuse(other);
|
| }
|
| @@ -91,11 +101,11 @@ if (string.codeUnitAt(i) >= 0x80) break checkAscii;
|
| return UTF8.encode(string);
|
| }
|
| List<int> convert(Object object) {
|
| -List<List<int>> bytes = ((__x10) => DDC$RT.cast(__x10, DDC$RT.type((List<dynamic> _) {
|
| +List<List<int>> bytes = ((__x16) => DDC$RT.cast(__x16, DDC$RT.type((List<dynamic> _) {
|
| }
|
| ), DDC$RT.type((List<List<int>> _) {
|
| }
|
| -), "CastLiteral", """line 338, column 29 of dart:convert/json.dart: """, __x10 is List<List<int>>, false))([]);
|
| +), "CastLiteral", """line 338, column 29 of dart:convert/json.dart: """, __x16 is List<List<int>>, false))([]);
|
| void addChunk(Uint8List chunk, int start, int end) {
|
| if (start > 0 || end < chunk.length) {
|
| int length = end - start;
|
| @@ -103,7 +113,7 @@ int length = end - start;
|
| }
|
| bytes.add(chunk);
|
| }
|
| - _JsonUtf8Stringifier.stringify(object, _indent, DDC$RT.cast(_toEncodable, Function, __t11, "CastGeneral", """line 352, column 36 of dart:convert/json.dart: """, _toEncodable is __t11, false), _bufferSize, addChunk);
|
| + _JsonUtf8Stringifier.stringify(object, _indent, DDC$RT.cast(_toEncodable, Function, __t14, "CastGeneral", """line 352, column 36 of dart:convert/json.dart: """, _toEncodable is __t14, false), _bufferSize, addChunk);
|
| if (bytes.length == 1) return bytes[0];
|
| int length = 0;
|
| for (int i = 0; i < bytes.length; i++) {
|
| @@ -129,11 +139,11 @@ byteSink = new ByteConversionSink.from(sink);
|
| return new _JsonUtf8EncoderSink(byteSink, _toEncodable, _indent, _bufferSize);
|
| }
|
| Stream<List<int>> bind(Stream<Object> stream) {
|
| -return ((__x13) => DDC$RT.cast(__x13, DDC$RT.type((DDC$async$.Stream<dynamic> _) {
|
| +return ((__x17) => DDC$RT.cast(__x17, DDC$RT.type((DDC$async$.Stream<dynamic> _) {
|
| }
|
| ), DDC$RT.type((DDC$async$.Stream<List<int>> _) {
|
| }
|
| -), "CastDynamic", """line 391, column 12 of dart:convert/json.dart: """, __x13 is DDC$async$.Stream<List<int>>, false))(super.bind(stream));
|
| +), "CastDynamic", """line 391, column 12 of dart:convert/json.dart: """, __x17 is DDC$async$.Stream<List<int>>, false))(super.bind(stream));
|
| }
|
| Converter<Object, dynamic> fuse(Converter<List<int>, dynamic> other) {
|
| return super.fuse(other);
|
| @@ -150,7 +160,7 @@ throw new StateError("Only one call to add allowed");
|
| }
|
| _isDone = true;
|
| ClosableStringSink stringSink = _sink.asStringSink();
|
| - _JsonStringStringifier.printOn(o, stringSink, DDC$RT.cast(_toEncodable, Function, __t7, "CastGeneral", """line 425, column 51 of dart:convert/json.dart: """, _toEncodable is __t7, false), _indent);
|
| + _JsonStringStringifier.printOn(o, stringSink, DDC$RT.cast(_toEncodable, Function, __t10, "CastGeneral", """line 425, column 51 of dart:convert/json.dart: """, _toEncodable is __t10, false), _indent);
|
| stringSink.close();
|
| }
|
| void close() {
|
| @@ -170,7 +180,7 @@ if (_isDone) {
|
| throw new StateError("Only one call to add allowed");
|
| }
|
| _isDone = true;
|
| - _JsonUtf8Stringifier.stringify(object, _indent, DDC$RT.cast(_toEncodable, Function, __t11, "CastGeneral", """line 455, column 53 of dart:convert/json.dart: """, _toEncodable is __t11, false), _bufferSize, _addChunk);
|
| + _JsonUtf8Stringifier.stringify(object, _indent, DDC$RT.cast(_toEncodable, Function, __t14, "CastGeneral", """line 455, column 53 of dart:convert/json.dart: """, _toEncodable is __t14, false), _bufferSize, _addChunk);
|
| _sink.close();
|
| }
|
| void close() {
|
| @@ -184,11 +194,11 @@ _isDone = true;
|
| const JsonDecoder([reviver(var key, var value)]) : this._reviver = reviver;
|
| dynamic convert(String input) => _parseJson(input, _reviver);
|
| external StringConversionSink startChunkedConversion(Sink<Object> sink);
|
| - Stream<Object> bind(Stream<String> stream) => ((__x14) => DDC$RT.cast(__x14, DDC$RT.type((DDC$async$.Stream<dynamic> _) {
|
| + Stream<Object> bind(Stream<String> stream) => ((__x18) => DDC$RT.cast(__x18, DDC$RT.type((DDC$async$.Stream<dynamic> _) {
|
| }
|
| ), DDC$RT.type((DDC$async$.Stream<Object> _) {
|
| }
|
| -), "CastDynamic", """line 507, column 49 of dart:convert/json.dart: """, __x14 is DDC$async$.Stream<Object>, false))(super.bind(stream));
|
| +), "CastDynamic", """line 507, column 49 of dart:convert/json.dart: """, __x18 is DDC$async$.Stream<Object>, false))(super.bind(stream));
|
| }
|
| external _parseJson(String source, reviver(key, value)) ;
|
| Object _defaultToEncodable(object) => object.toJson();
|
| @@ -208,7 +218,7 @@ _isDone = true;
|
| static const int CHAR_u = 0x75;
|
| final List _seen = new List();
|
| final Function _toEncodable;
|
| - _JsonStringifier(Object _toEncodable(Object o)) : _toEncodable = (_toEncodable != null) ? _toEncodable : _defaultToEncodable;
|
| + _JsonStringifier(Object _toEncodable(Object o)) : _toEncodable = ((__x19) => DDC$RT.cast(__x19, dynamic, Function, "CastGeneral", """line 547, column 24 of dart:convert/json.dart: """, __x19 is Function, true))((_toEncodable != null) ? _toEncodable : _defaultToEncodable);
|
| void writeString(String characters);
|
| void writeStringSlice(String characters, int start, int end);
|
| void writeCharCode(int charCode);
|
| @@ -379,11 +389,11 @@ writeString('{}');
|
| writeString('{\n');
|
| _indentLevel++;
|
| bool first = true;
|
| - map.forEach(((__x23) => DDC$RT.wrap((dynamic f(String __u15, Object __u16)) {
|
| + map.forEach(((__x28) => DDC$RT.wrap((dynamic f(String __u20, Object __u21)) {
|
| dynamic c(String x0, Object x1) => f(DDC$RT.cast(x0, dynamic, String, "CastParam", """line 773, column 19 of dart:convert/json.dart: """, x0 is String, true), x1);
|
| return f == null ? null : c;
|
| }
|
| -, __x23, __t20, __t17, "WrapLiteral", """line 773, column 19 of dart:convert/json.dart: """, __x23 is __t17))((String key, Object value) {
|
| +, __x28, __t25, __t22, "WrapLiteral", """line 773, column 19 of dart:convert/json.dart: """, __x28 is __t22))((String key, Object value) {
|
| if (!first) {
|
| writeString(",\n");
|
| }
|
| @@ -403,7 +413,7 @@ writeString(",\n");
|
| }
|
| }
|
| class _JsonStringStringifier extends _JsonStringifier {final StringSink _sink;
|
| - _JsonStringStringifier(this._sink, _toEncodable) : super(DDC$RT.cast(_toEncodable, dynamic, __t24, "CastGeneral", """line 798, column 60 of dart:convert/json.dart: """, _toEncodable is __t24, false));
|
| + _JsonStringStringifier(this._sink, _toEncodable) : super(DDC$RT.cast(_toEncodable, dynamic, __t8, "CastGeneral", """line 798, column 60 of dart:convert/json.dart: """, _toEncodable is __t8, false));
|
| static String stringify(object, toEncodable(object), String indent) {
|
| StringBuffer output = new StringBuffer();
|
| printOn(object, output, toEncodable, indent);
|
| @@ -442,7 +452,7 @@ for (int i = 0; i < count; i++) writeString(_indent);
|
| final Function addChunk;
|
| Uint8List buffer;
|
| int index = 0;
|
| - _JsonUtf8Stringifier(toEncodable, int bufferSize, this.addChunk) : super(DDC$RT.cast(toEncodable, dynamic, __t24, "CastGeneral", """line 874, column 15 of dart:convert/json.dart: """, toEncodable is __t24, false)), this.bufferSize = bufferSize, buffer = new Uint8List(bufferSize);
|
| + _JsonUtf8Stringifier(toEncodable, int bufferSize, this.addChunk) : super(DDC$RT.cast(toEncodable, dynamic, __t8, "CastGeneral", """line 874, column 15 of dart:convert/json.dart: """, toEncodable is __t8, false)), this.bufferSize = bufferSize, buffer = new Uint8List(bufferSize);
|
| static void stringify(Object object, List<int> indent, toEncodableFunction(Object o), int bufferSize, void addChunk(Uint8List chunk, int start, int end)) {
|
| _JsonUtf8Stringifier stringifier;
|
| if (indent != null) {
|
| @@ -553,8 +563,8 @@ writeByte(indent[i]);
|
| }
|
| }
|
| }
|
| - typedef dynamic __t7(dynamic __u8);
|
| - typedef dynamic __t11(Object __u12);
|
| - typedef void __t17(dynamic __u18, dynamic __u19);
|
| - typedef dynamic __t20(String __u21, Object __u22);
|
| - typedef Object __t24(Object __u25);
|
| + typedef Object __t8(Object __u9);
|
| + typedef dynamic __t10(dynamic __u11);
|
| + typedef dynamic __t14(Object __u15);
|
| + typedef void __t22(dynamic __u23, dynamic __u24);
|
| + typedef dynamic __t25(String __u26, Object __u27);
|
|
|