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

Unified Diff: test/mjsunit/json.js

Issue 2010533002: [json] support replacer function in BasicJsonStringifier. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@jsonproplist
Patch Set: fix Created 4 years, 7 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 | « src/runtime/runtime-json.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/json.js
diff --git a/test/mjsunit/json.js b/test/mjsunit/json.js
index 44548e4c13e90ac6e297eedae20b5d8064ae34c6..3652febc3c41d8b9c7fb217fdafb8c0c53a8c345 100644
--- a/test/mjsunit/json.js
+++ b/test/mjsunit/json.js
@@ -520,3 +520,6 @@ reviver = function(p, v) {
return p === "" ? v : 42;
}
assertEquals({a: 0, b: 1}, JSON.parse('{"a":0,"b":1}', reviver));
+
+reviver = (k, v) => (v === Infinity) ? "inf" : v;
+assertEquals('{"":"inf"}', JSON.stringify({"":Infinity}, reviver));
« no previous file with comments | « src/runtime/runtime-json.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698