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

Unified Diff: src/builtins.cc

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/builtins.h ('k') | src/js/array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index db84406fdd0ff88cf11a8a608a8e053aae21bd17..7604397844b24571da34abe1fab61cd0fd6e64e6 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -18,6 +18,7 @@
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"
+#include "src/json-stringifier.h"
#include "src/messages.h"
#include "src/profiler/cpu-profiler.h"
#include "src/property-descriptor.h"
@@ -2179,6 +2180,16 @@ BUILTIN(GlobalEval) {
Execution::Call(isolate, function, target_global_proxy, 0, nullptr));
}
+// ES6 section 24.3.2 JSON.stringify.
+BUILTIN(JsonStringify) {
+ HandleScope scope(isolate);
+ JsonStringifier stringifier(isolate);
+ Handle<Object> object = args.atOrUndefined(isolate, 1);
+ Handle<Object> replacer = args.atOrUndefined(isolate, 2);
+ Handle<Object> indent = args.atOrUndefined(isolate, 3);
+ RETURN_RESULT_OR_FAILURE(isolate,
+ stringifier.Stringify(object, replacer, indent));
+}
// -----------------------------------------------------------------------------
// ES6 section 20.2.2 Function Properties of the Math Object
« no previous file with comments | « src/builtins.h ('k') | src/js/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698