Closed GoogleCodeExporter closed 8 years ago
Thank you for pointing it out.
It behaves like this because of backward compatibility: Some user may override
toString() to generate their own JSON literal, which cannot be escaped to a
JSON string or the customization will not work. Although later we suggest to
use toJSONString() in JSONAware interface to generate custom JSON literal
instead, we don't want to break any previous codes in user's environment.
Original comment by fangyid...@gmail.com
on 4 Sep 2014 at 5:05
but is it possible to provide an optional argument in writeJSONString() to
choose the fallback behavior?
like, by default use toString() but if it's invoked like writeJSONString(obj,
true) then use escaped toString()?
Original comment by w3c...@gmail.com
on 4 Sep 2014 at 5:44
Original issue reported on code.google.com by
w3c...@gmail.com
on 3 Sep 2014 at 9:45