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

Side by Side Diff: sdk/lib/convert/json.dart

Issue 2529393002: Make core libraries use generic method syntax. (Closed)
Patch Set: Change chunked conversion back. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.convert; 5 part of dart.convert;
6 6
7 /** 7 /**
8 * Error thrown by JSON serialization if an object cannot be serialized. 8 * Error thrown by JSON serialization if an object cannot be serialized.
9 * 9 *
10 * The [unsupportedObject] field holds that object that failed to be serialized. 10 * The [unsupportedObject] field holds that object that failed to be serialized.
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 return new _JsonUtf8EncoderSink(sink._sink, _toEncodable, 261 return new _JsonUtf8EncoderSink(sink._sink, _toEncodable,
262 JsonUtf8Encoder._utf8Encode(indent), 262 JsonUtf8Encoder._utf8Encode(indent),
263 JsonUtf8Encoder.DEFAULT_BUFFER_SIZE); 263 JsonUtf8Encoder.DEFAULT_BUFFER_SIZE);
264 } 264 }
265 return new _JsonEncoderSink(sink, _toEncodable, indent); 265 return new _JsonEncoderSink(sink, _toEncodable, indent);
266 } 266 }
267 267
268 // Override the base class's bind, to provide a better type. 268 // Override the base class's bind, to provide a better type.
269 Stream<String> bind(Stream<Object> stream) => super.bind(stream); 269 Stream<String> bind(Stream<Object> stream) => super.bind(stream);
270 270
271 Converter<Object, dynamic/*=T*/> fuse/*<T>*/( 271 Converter<Object, T> fuse<T>(
floitsch 2016/12/19 19:14:45 should fit on the same line.
Lasse Reichstein Nielsen 2017/01/03 10:33:20 Done.
272 Converter<String, dynamic/*=T*/> other) { 272 Converter<String, T> other) {
273 if (other is Utf8Encoder) { 273 if (other is Utf8Encoder) {
274 return new JsonUtf8Encoder(indent, _toEncodable) 274 return new JsonUtf8Encoder(indent, _toEncodable)
275 as dynamic/*=Converter<Object, T>*/; 275 as dynamic/*=Converter<Object, T>*/;
276 } 276 }
277 return super.fuse/*<T>*/(other); 277 return super.fuse<T>(other);
278 } 278 }
279 } 279 }
280 280
281 /** 281 /**
282 * Encoder that encodes a single object as a UTF-8 encoded JSON string. 282 * Encoder that encodes a single object as a UTF-8 encoded JSON string.
283 * 283 *
284 * This encoder works equivalently to first converting the object to 284 * This encoder works equivalently to first converting the object to
285 * a JSON string, and then UTF-8 encoding the string, but without 285 * a JSON string, and then UTF-8 encoding the string, but without
286 * creating an intermediate string. 286 * creating an intermediate string.
287 */ 287 */
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 buffer.setRange(index, end, indent); 1059 buffer.setRange(index, end, indent);
1060 index = end; 1060 index = end;
1061 } else { 1061 } else {
1062 for (int i = 0; i < indentLength; i++) { 1062 for (int i = 0; i < indentLength; i++) {
1063 writeByte(indent[i]); 1063 writeByte(indent[i]);
1064 } 1064 }
1065 } 1065 }
1066 } 1066 }
1067 } 1067 }
1068 } 1068 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698