JSON support for BigInt in Chrome/V8
anders.rundgren.net at gmail.com
Sat Jul 14 08:35:53 UTC 2018
var small = BigInt("5");
var big = BigInt("5555555555555555555555555500003");
VM330:1 Uncaught TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
JSON Number serialization has apparently reached a new level (of confusion).
Personally I don't see the problem. XML did just fine without hard-coded data types.
However, when you are outside of that scope, the point with the JSON type system gets pretty much zero since you anyway need to map extended types.
Oracle's JSON-B solution which serializes small values as Number and large values as String rather than having a unified serialization based on the underlying data type seems like a pretty broken concept although indeed fully conforming to the JSON specification. "Like the Devil reads the Bible" as we say in Scandinavia :-)
Yeah, and of course adding support for comments.
More information about the es-discuss