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

Unified Diff: tests/lib/convert/codec2_test.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/json/json.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/convert/codec2_test.dart
diff --git a/tests/lib/convert/codec2_test.dart b/tests/lib/convert/codec2_test.dart
index fce07ea580c9a3347071594ab276f8e44da458c0..e8fa875df22eaf7f11a272ab9c4799572e7fc77b 100644
--- a/tests/lib/convert/codec2_test.dart
+++ b/tests/lib/convert/codec2_test.dart
@@ -22,12 +22,12 @@ main() {
// Test that the reviver is passed to the decoder.
var decoded = JSON.decode('{"p": 5}', reviver: (k, v) {
- if (k == "") return v;
+ if (k == null) return v;
return v * 2;
});
Expect.equals(10, decoded["p"]);
var jsonWithReviver = new JsonCodec.withReviver((k, v) {
- if (k == "") return v;
+ if (k == null) return v;
return v * 2;
});
decoded = jsonWithReviver.decode('{"p": 5}');
« no previous file with comments | « sdk/lib/json/json.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698