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

Unified Diff: sdk/lib/convert/json.dart

Issue 1376043002: add JsonCode example (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/convert/json.dart
diff --git a/sdk/lib/convert/json.dart b/sdk/lib/convert/json.dart
index d3624ab10e7491242d7542e607ef436684b20088..08eb79708b7208cf3b0f60c258dbbbbcb0206602 100644
--- a/sdk/lib/convert/json.dart
+++ b/sdk/lib/convert/json.dart
@@ -53,8 +53,8 @@ class JsonCyclicError extends JsonUnsupportedObjectError {
*
* Examples:
*
- * var encoded = JSON.encode([1, 2, { "a": null }]);
- * var decoded = JSON.decode('["foo", { "bar": 499 }]');
+ * var encoded = JSON.encode([1, 2, { "a": null }]);
Lasse Reichstein Nielsen 2015/09/30 06:20:31 Make sure this is indented enough. It seems to be
+ * var decoded = JSON.decode('["foo", { "bar": 499 }]');
*/
const JsonCodec JSON = const JsonCodec();
@@ -65,6 +65,11 @@ typedef _ToEncodable(var o);
/**
* A [JsonCodec] encodes JSON objects to strings and decodes strings to
* JSON objects.
+ *
+ * Examples:
+ *
+ * var encoded = JSON.encode([1, 2, { "a": null }]);
+ * var decoded = JSON.decode('["foo", { "bar": 499 }]');
*/
class JsonCodec extends Codec<Object, String> {
final _Reviver _reviver;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698