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

Unified Diff: src/json-stringifier.h

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/js/json.js ('k') | src/json-stringifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index ffde4dca6b10d8df1116373e66ad62edcd59100e..5ce8f50cb1b565fa554a6d185d6316923edc22e0 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -11,19 +11,16 @@
namespace v8 {
namespace internal {
-class BasicJsonStringifier BASE_EMBEDDED {
+class JsonStringifier BASE_EMBEDDED {
public:
- explicit BasicJsonStringifier(Isolate* isolate);
+ explicit JsonStringifier(Isolate* isolate);
- ~BasicJsonStringifier() { DeleteArray(gap_); }
+ ~JsonStringifier() { DeleteArray(gap_); }
MUST_USE_RESULT MaybeHandle<Object> Stringify(Handle<Object> object,
Handle<Object> replacer,
Handle<Object> gap);
- MUST_USE_RESULT static MaybeHandle<Object> StringifyString(
- Isolate* isolate, Handle<String> object);
-
private:
enum Result { UNCHANGED, SUCCESS, EXCEPTION };
@@ -33,6 +30,8 @@ class BasicJsonStringifier BASE_EMBEDDED {
MUST_USE_RESULT MaybeHandle<Object> ApplyToJsonFunction(
Handle<Object> object,
Handle<Object> key);
+ MUST_USE_RESULT MaybeHandle<Object> ApplyReplacerFunction(
+ Handle<Object> object, Handle<Object> key);
// Entry point to serialize the object.
INLINE(Result SerializeObject(Handle<Object> obj)) {
@@ -100,6 +99,8 @@ class BasicJsonStringifier BASE_EMBEDDED {
INLINE(void Unindent() { indent_--; });
INLINE(void Separator(bool first));
+ Handle<JSReceiver> CurrentHolder(Handle<Object> value);
+
Result StackPush(Handle<Object> object);
void StackPop();
@@ -110,6 +111,7 @@ class BasicJsonStringifier BASE_EMBEDDED {
Handle<String> tojson_string_;
Handle<JSArray> stack_;
Handle<FixedArray> property_list_;
+ Handle<JSReceiver> replacer_function_;
uc16* gap_;
int indent_;
« no previous file with comments | « src/js/json.js ('k') | src/json-stringifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698