Handle the exception of Js_json.stringifyAny
This PR fixes #5598
The exception thrown by JSON.stringify will be handled with try-with, instead of renaming it. The renaming would cause a breaking change, so we won't do that.
It is proper thatstringifyAny returns option<string> because it is possible to return the undefined
Why is the exn function returning an option type?
The javascript stringify function returns two types of values and the exception. Two types of values are string and undefined. If stringifyAny() is called with no argument(actually there is unit), it will return the undefined which is corresponded to None in ReScript.
@mununki what's the status of this? Starting to move stuff to v12, unless there are plans for things to progress soon.
Maybe this belongs in Core now?
Maybe this belongs in Core now?
Great let's move it then.
Technically we need close this and open another one: different GitHub org.
Sorry for being late, is a PR opened in the Core for this?