Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index bc6edf5cea8ab4bb2d64e7716c8a8ddbb0fcd133..80e1c9fc3f8f3fa5d6e2ab6b8a1e943f40193efb 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -1665,9 +1665,8 @@ struct SampleInfo { |
StateTag vm_state; |
}; |
- |
/** |
- * A JSON Parser. |
+ * A JSON Parser and Stringifier. |
*/ |
class V8_EXPORT JSON { |
public: |
@@ -1678,10 +1677,23 @@ class V8_EXPORT JSON { |
* \param json_string The string to parse. |
* \return The corresponding value if successfully parsed. |
*/ |
- static V8_DEPRECATED("Use maybe version", |
+ static V8_DEPRECATED("Use the maybe version taking context", |
Local<Value> Parse(Local<String> json_string)); |
+ static V8_DEPRECATE_SOON("Use the maybe version taking context", |
+ MaybeLocal<Value> Parse(Isolate* isolate, |
+ Local<String> json_string)); |
static V8_WARN_UNUSED_RESULT MaybeLocal<Value> Parse( |
- Isolate* isolate, Local<String> json_string); |
+ Local<Context> context, Local<String> json_string); |
+ |
+ /** |
+ * Tries to stringify the JSON-serializable object |json_object| and returns |
+ * it as string if successful. |
+ * |
+ * \param json_object The JSON-serializable object to stringify. |
+ * \return The corresponding string if successfully stringified. |
+ */ |
+ static V8_WARN_UNUSED_RESULT MaybeLocal<String> Stringify( |
+ Local<Context> context, Local<Object> json_object); |
}; |