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

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

Issue 195203002: Fix various documentation issues. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/async/future.dart ('k') | sdk/lib/core/map.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 * 75 *
76 * The [reviver] function is called during decoding. It is invoked 76 * The [reviver] function is called during decoding. It is invoked
77 * once for each object or list property that has been parsed. 77 * once for each object or list property that has been parsed.
78 * The `key` argument is either the 78 * The `key` argument is either the
79 * integer list index for a list property, the string map key for object 79 * integer list index for a list property, the string map key for object
80 * properties, or `null` for the final result. 80 * properties, or `null` for the final result.
81 * 81 *
82 * If [reviver] is omitted, it defaults to returning the value argument. 82 * If [reviver] is omitted, it defaults to returning the value argument.
83 * 83 *
84 * The [toEncodable] function is used during encoding. It is invoked for 84 * The [toEncodable] function is used during encoding. It is invoked for
85 * values that are not directly encodable to a JSON 85 * values that are not directly encodable to a JSON1toE
Søren Gjesse 2014/03/14 08:10:15 What is "a JSON1toE string"?
86 * string (a value that is not a number, boolean, string, null, list or a map 86 * string (a value that is not a number, boolean, string, null, list or a map
87 * with string keys). The function must return an object that is directly 87 * with string keys). The function must return an object that is directly
88 * encodable. 88 * encodable. The elements of a returned list and values of a returned map
89 * do not need be directly encodable, and if they aren't, `toEncodable` will
90 * be used on them as well.
91 * Please notice that it is possible to cause an infinite recursive
92 * regress in this way, by effectively creating an infinite data structure
93 * through repeated call to `toEncodable`.
89 * 94 *
90 * If [toEncodable] is omitted, it defaults to a function that returns the 95 * If [toEncodable] is omitted, it defaults to a function that returns the
91 * result of calling `.toJson()` on the unencodable object. 96 * result of calling `.toJson()` on the unencodable object.
92 */ 97 */
93 const JsonCodec({reviver(var key, var value), toEncodable(var object)}) 98 const JsonCodec({reviver(var key, var value), toEncodable(var object)})
94 : _reviver = reviver, 99 : _reviver = reviver,
95 _toEncodable = toEncodable; 100 _toEncodable = toEncodable;
96 101
97 /** 102 /**
98 * Creates a `JsonCodec` with the given reviver. 103 * Creates a `JsonCodec` with the given reviver.
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 first = false; 501 first = false;
497 }); 502 });
498 _sink.write('}'); 503 _sink.write('}');
499 _seen.remove(object); 504 _seen.remove(object);
500 return true; 505 return true;
501 } else { 506 } else {
502 return false; 507 return false;
503 } 508 }
504 } 509 }
505 } 510 }
OLDNEW
« no previous file with comments | « sdk/lib/async/future.dart ('k') | sdk/lib/core/map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698