Make v8::JSON::Stringify take Local<Value> instead of Local<Object>.
It is legal to stringify other kinds of values, like strings and numbers. Since Local<Object> is convertible to Local<Value>, this is unlikely to break callers. Bug: v8:6810 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: Ie8e97c86308d62cdf0a2a17490a6e20de58fc76e Reviewed-on: https://chromium-review.googlesource.com/657633 Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#47935}
This commit is contained in:
parent
5100a00960
commit
6716a7f641
@ -1829,7 +1829,7 @@ class V8_EXPORT JSON {
|
||||
* \return The corresponding string if successfully stringified.
|
||||
*/
|
||||
static V8_WARN_UNUSED_RESULT MaybeLocal<String> Stringify(
|
||||
Local<Context> context, Local<Object> json_object,
|
||||
Local<Context> context, Local<Value> json_object,
|
||||
Local<String> gap = Local<String>());
|
||||
};
|
||||
|
||||
|
@ -3275,7 +3275,7 @@ Local<Value> JSON::Parse(Local<String> json_string) {
|
||||
}
|
||||
|
||||
MaybeLocal<String> JSON::Stringify(Local<Context> context,
|
||||
Local<Object> json_object,
|
||||
Local<Value> json_object,
|
||||
Local<String> gap) {
|
||||
PREPARE_FOR_EXECUTION(context, JSON, Stringify, String);
|
||||
i::Handle<i::Object> object = Utils::OpenHandle(*json_object);
|
||||
|
Loading…
Reference in New Issue
Block a user