[Webkit-unassigned] [Bug 170442] Safari 10.1 JSON.parse returns incorrect object for numeric keys with decimal values
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Apr 26 11:49:32 PDT 2017
https://bugs.webkit.org/show_bug.cgi?id=170442
--- Comment #9 from Saam Barati <sbarati at apple.com> ---
(In reply to PiwEL from comment #8)
> It's the same problem even when the first key isn't 0, for JSON.parse and
> JSON.stringify.
>
> JSON.stringify({ 8: 13.2, 111544: 132})
> > "{\"0\":null,\"1\":null,\"2\":null,\"3\":null,\"4\":null,\"5\":null,\"6\":null,\"7\":null,\"8\":13.2,\"111544\":132}"
>
> If these are parseable to integers, this doesn't happen either.
> JSON.stringify({ 8: 132, 111544: 132})
> > "{\"8\":132,\"111544\":132}"
>
>
> And in the other way :
> JSON.parse("{\"8\":13.2,\"111544\":132}");
> > {0: NaN, 1: NaN, 2: NaN, 3: NaN, 4: NaN, 5: NaN, 6: NaN, 7: NaN, 8: 13.2, 111544: 132}
>
> I guess tests for theses cases should also be added, but I'm sorry, I'm new
> here and I don't know how to do it.
Thanks for giving us this test case. We already added a test similar to this.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170426/38937923/attachment.html>
More information about the webkit-unassigned
mailing list