JSON support for BigInt in Chrome/V8
Jordan Harband
ljharb at gmail.com
Tue Jul 17 18:10:10 UTC 2018
You already can't use `new` with `Symbol`, and you don't ever want to use
`new` with a primitive's constructor anyways.
On Tue, Jul 17, 2018 at 10:11 AM, Anders Rundgren <
anders.rundgren.net at gmail.com> wrote:
> On 2018-07-17 17:44, Cyril Auburtin wrote:
>
>> It would be great to have
>> ```js
>> JSON.stringify({x: 5n, y: BigInt('6')}) === '{"x":5n,"y":6n}'
>> JSON.parse('{"x": 3n}') // {x: 3n}
>> ```
>> I don't know how feasable it would be, maybe have a new JSON5 object if
>> JSON can't be changed for some reasons
>>
>
> If compatibility with other platforms which already have addressed this
> issue is an objective, there are essentially only three workable schemes:
>
> - Use JSON exactly as specified [*]; without restrictions on numbers.
> Example: Microsoft's Json.NET.
>
> - Use an adaptive I-JSON scheme. Example: Oracle's JSON-B.
>
> - Use use a normalized I-JSON scheme. Example: Close to a de-facto
> standard for systems targeting multiple platforms as well as for [probably
> all] IETF standards defining JSON structures.
>
> Anders
>
> *] Ignoring footnote-like interoperability considerations for JSON numbers.
>
>
>
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180717/d1bfee5e/attachment.html>
More information about the es-discuss
mailing list