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

Unified Diff: src/js/json.js

Issue 2006663002: [json] implement JSON.stringify gap pre-processing in C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@jsonrefactor
Patch Set: 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/api.cc ('k') | src/json-stringifier.h » ('j') | src/json-stringifier.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/json.js
diff --git a/src/js/json.js b/src/js/json.js
index 456b20e7c38dec3267986b9ecb60d77f3b73b4d3..e2f7646f21e7309b3e0daf918b45f48dd9cb08e9 100644
--- a/src/js/json.js
+++ b/src/js/json.js
@@ -233,6 +233,9 @@ function JSONStringify(value, replacer, space) {
space = TO_STRING(space);
}
}
+ if (!IS_CALLABLE(replacer) && !property_list) {
+ return %BasicJSONStringify(value, space);
+ }
var gap;
if (IS_NUMBER(space)) {
space = MaxSimple(0, MinSimple(TO_INTEGER(space), 10));
@@ -246,9 +249,6 @@ function JSONStringify(value, replacer, space) {
} else {
gap = "";
}
- if (!IS_CALLABLE(replacer) && !property_list) {
- return %BasicJSONStringify(value, gap);
- }
return JSONSerialize('', {'': value}, replacer, new Stack(), "", gap);
}
« no previous file with comments | « src/api.cc ('k') | src/json-stringifier.h » ('j') | src/json-stringifier.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698