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

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

Issue 23688003: Make the result of JSON.decode be marked by "null" in the reviver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | « sdk/lib/_internal/lib/convert_patch.dart ('k') | tests/lib/convert/codec2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/json/json.dart
diff --git a/sdk/lib/json/json.dart b/sdk/lib/json/json.dart
index a6b602b55142557897f548618266ffdfe24c62d3..efc2621890650970131409125c76c5187f06d05c 100644
--- a/sdk/lib/json/json.dart
+++ b/sdk/lib/json/json.dart
@@ -29,6 +29,10 @@ export "dart:convert" show JsonUnsupportedObjectError, JsonCyclicError;
* Throws [FormatException] if the input is not valid JSON text.
*/
parse(String json, [reviver(var key, var value)]) {
+ if (reviver != null) {
+ var original = reviver;
+ reviver = (key, value) => original(key == null ? "" : key, value);
+ }
return JSON.decode(json, reviver: reviver);
}
« no previous file with comments | « sdk/lib/_internal/lib/convert_patch.dart ('k') | tests/lib/convert/codec2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698