This is the parsing side equivalent to "canonicalized".  Any
security-sensitive application of "canonical JSON" should have a strict
verifier confirming that the input is canonical; this verifier would
presumably also throw for out-of-range numbers as you suggest.
  --scott

On Sun, Mar 18, 2018, 9:33 PM Michał Wadas <[email protected]> wrote:

> Fact: JSON allows arbitrary precision numbers.
> Problem: JavaScript is unable to express these numbers.
>
> Proposed solution: introduce JSON.safeParse. This method will work as
> JSON.parse, but throwing on values that can't be accurately represented by
> IEEE 754 64-bit float.
>
> Alternative: allow user to specify number class - eg. by adding options
> object with optional method "parseNumber", overwriting default behaviour of
> using builtin number type.
>
> Any thoughts on this?
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to