[Issue 14727] std.json incorrectly supports inf and nan

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jun 24 00:59:53 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14727

--- Comment #2 from Lumi Pakkanen <lumi.pakkanen at gmail.com> ---
(In reply to ag0aep6g from comment #1)
> I think this has been fixed recently. Git head phobos throws
> "std.json.JSONException at std/json.d(1170): Cannot encode Infinity. Consider
> passing the specialFloatLiterals flag."
> 
> Corresponding pull request:
> https://github.com/D-Programming-Language/phobos/pull/3141
> 
> The mentioned specialFloatLiterals is not set by default. Setting it makes
> it so that inf/nan get stringified to JSON strings (not null). Are you ok
> with this?

Those options are nice but I would like to have the third option that works
like javascript's JSON.stringify and encodes inf and nan as null.

--


More information about the Digitalmars-d-bugs mailing list