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

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') | src/json-stringifier.cc » ('J')
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 122999607b6d649e5a9034b294d1ff09824d7aa8..1abf1ea1f02ebfb69724568c666e69469f420aa9 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,15 @@ 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);
+ RETURN_RESULT_OR_FAILURE(
+ isolate, stringifier.Stringify(args.atOrUndefined(isolate, 1),
+ args.atOrUndefined(isolate, 2),
+ args.atOrUndefined(isolate, 3)));
Camillo Bruni 2016/05/24 18:24:55 nit: would you mind fetching the arguments into se
+}
// -----------------------------------------------------------------------------
// 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') | src/json-stringifier.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698