parseJSON bug

David d at dav1d.de
Thu Aug 8 05:37:28 PDT 2013


Am 08.08.2013 14:15, schrieb khurshid:
> On Thursday, 8 August 2013 at 12:08:00 UTC, khurshid wrote:
>>
>> std.json  parseJSON has a bug,
>>
>> //                         leading whitespaces
>> auto json = parseJSON("1                                  .000");
>>
>> -- should throws, but it's success parsed as `1.000` .
>>
>>
>> Khurshid...
> 
> Or more...
> 
> auto json = parseJSON(`{ "one": 1        .24E          +1   
> }`);//should throws.
> writeln(toJSON(&json)); // printed `{"one":12.4}`

Why is this a bug? JSON ignores whitespaces outside strings.


More information about the Digitalmars-d mailing list