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

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

Issue 52333002: Update type signature of JSON codec. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 75f232e60ecc337436aff5641413a1502f7ad07c..efac7acb035435da2f010fbd9cabf975022c04f7 100644
--- a/sdk/lib/convert/json.dart
+++ b/sdk/lib/convert/json.dart
@@ -86,7 +86,7 @@ class JsonCodec extends Codec<Object, String> {
*
* The default [reviver] (when not provided) is the identity function.
*/
- Object decode(String source, {reviver(var key, var value)}) {
+ dynamic decode(String source, {reviver(var key, var value)}) {
if (reviver == null) return decoder.convert(source);
return new JsonDecoder(reviver).convert(source);
}
@@ -102,7 +102,7 @@ class JsonCodec extends Codec<Object, String> {
* If [toEncodable] is omitted, it defaults to calling `.toJson()` on the
* unencodable object.
*/
- Object encode(Object value, {toEncodable(var object)}) {
+ String encode(Object value, {toEncodable(var object)}) {
if (toEncodable == null) return encoder.convert(value);
return new JsonEncoder(toEncodable).convert(value);
}
@@ -117,7 +117,7 @@ class _ReviverJsonCodec extends JsonCodec {
final _Reviver _reviver;
_ReviverJsonCodec(this._reviver);
- Object decode(String source, {reviver(var key, var value)}) {
+ dynamic decode(String source, {reviver(var key, var value)}) {
if (reviver == null) reviver = _reviver;
return new JsonDecoder(reviver).convert(source);
}
@@ -256,7 +256,7 @@ class JsonDecoder extends Converter<String, Object> {
*
* Throws [FormatException] if the input is not valid JSON text.
*/
- Object convert(String input) => _parseJson(input, _reviver);
+ dynamic convert(String input) => _parseJson(input, _reviver);
/**
* Starts a conversion from a chunked JSON string to its corresponding
« 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