Title: [236660] trunk/Source/_javascript_Core
- Revision
- 236660
- Author
- commit-qu...@webkit.org
- Date
- 2018-10-01 08:12:24 -0700 (Mon, 01 Oct 2018)
Log Message
[JSC] Add a JSONStringify overload that receives a JSValue space
https://bugs.webkit.org/show_bug.cgi?id=190131
Patch by Koby Boyango <kob...@mce-sys.com> on 2018-10-01
Reviewed by Yusuke Suzuki.
* runtime/JSONObject.cpp:
* runtime/JSONObject.h:
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (236659 => 236660)
--- trunk/Source/_javascript_Core/ChangeLog 2018-10-01 13:49:48 UTC (rev 236659)
+++ trunk/Source/_javascript_Core/ChangeLog 2018-10-01 15:12:24 UTC (rev 236660)
@@ -1,3 +1,13 @@
+2018-10-01 Koby Boyango <kob...@mce-sys.com>
+
+ [JSC] Add a JSONStringify overload that receives a JSValue space
+ https://bugs.webkit.org/show_bug.cgi?id=190131
+
+ Reviewed by Yusuke Suzuki.
+
+ * runtime/JSONObject.cpp:
+ * runtime/JSONObject.h:
+
2018-10-01 Commit Queue <commit-qu...@webkit.org>
Unreviewed, rolling out r236647.
Modified: trunk/Source/_javascript_Core/runtime/JSONObject.cpp (236659 => 236660)
--- trunk/Source/_javascript_Core/runtime/JSONObject.cpp 2018-10-01 13:49:48 UTC (rev 236659)
+++ trunk/Source/_javascript_Core/runtime/JSONObject.cpp 2018-10-01 15:12:24 UTC (rev 236660)
@@ -854,11 +854,11 @@
return jsonParser.tryLiteralParse();
}
-String JSONStringify(ExecState* exec, JSValue value, unsigned indent)
+String JSONStringify(ExecState* exec, JSValue value, JSValue space)
{
VM& vm = exec->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
- Stringifier stringifier(exec, jsNull(), jsNumber(indent));
+ Stringifier stringifier(exec, jsNull(), space);
RETURN_IF_EXCEPTION(throwScope, { });
JSValue result = stringifier.stringify(value);
if (UNLIKELY(throwScope.exception()) || result.isUndefinedOrNull())
@@ -866,4 +866,9 @@
return result.getString(exec);
}
+String JSONStringify(ExecState* exec, JSValue value, unsigned indent)
+{
+ return JSONStringify(exec, value, jsNumber(indent));
+}
+
} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/JSONObject.h (236659 => 236660)
--- trunk/Source/_javascript_Core/runtime/JSONObject.h 2018-10-01 13:49:48 UTC (rev 236659)
+++ trunk/Source/_javascript_Core/runtime/JSONObject.h 2018-10-01 15:12:24 UTC (rev 236660)
@@ -56,6 +56,7 @@
};
JS_EXPORT_PRIVATE JSValue JSONParse(ExecState*, const String&);
+JS_EXPORT_PRIVATE String JSONStringify(ExecState*, JSValue, JSValue space);
JS_EXPORT_PRIVATE String JSONStringify(ExecState*, JSValue, unsigned indent);
} // namespace JSC
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes