What steps will reproduce the problem?
1. use JSONValue.writeJsonString() or JSONValue.toJsonString() providing a
value argument of an unsupported type.
What is the expected output? What do you see instead?
the library already provides a fallback mechanism that outputs value.toString() when passing an unsupported object. This is okay, but i would expect to get surrounding quotes, as when writing normal Strings.
What version of the product are you using?
trunk (same behavior on 1.1)
The attached patch should solve the issue: it simply uses the same behavior for
String instances (escape + surrounding quotes), and for the fallback case as
well.
thanks,
alberto
Original issue reported on code.google.com by sanita.c...@gmail.com on 4 Aug 2010 at 7:13
Original issue reported on code.google.com by
sanita.c...@gmail.com
on 4 Aug 2010 at 7:13Attachments: