You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In and of itself, this is unsurprising: Use new features, it won't work. The place where this is maybe surprising is with the support for mixed-type arrays. Consider the following examples:
#
json
1.0.0-rc.1
0.5
1
{a: [1, 2]}
a = [ 1, 2 ]
a = [ 1, 2 ]
2
{a: [1.0, 2]}
a = [ 1, 2 ]
a = [ 1, 2 ]
3
{a: [1.1, 2]}
a = [ 1.1, 2 ]
a = [ 1.1, 2.0 ]
4
{a: [1.1, 2n]}
a = [1.1, 2 ]
a = [ 1.1, 2.0 ]
5
{a: [1.1, 9999999999999999n]}
a = [ 1.1, 9_999_999_999_999_999 ]
a = [ 1.1, 9_999_999_999_999_999.0 ]
So my thinking:
this is all good
numbers are numbers in js, we can't tell 1.0 apart from 1, so this is fine
the 1.0.0-rc.1 version is perfectly valid, but nonetheless, let's update this to be compat with 0.5. no reason to introduce gratuitous backward incompatibility -- a compat doc under 0.5 should still produce a compat doc on 1.0.0-rc.1
no change to 1.0.0-rc.1 version, 0.5 should throw as a bigint is defintiely not a float
same as 4, as the fact that bigints are not floats is even more important here as if you load the 0.5 doc you'll get a value of 10000000000000000 due to lack of available precision.
The text was updated successfully, but these errors were encountered:
Part of me feels like it should round trip, but I suppose there are many other TOML documents that don't perfectly round trip and they are equivalent under JS. (Not the least because whitespace, comments.)
In and of itself, this is unsurprising: Use new features, it won't work. The place where this is maybe surprising is with the support for mixed-type arrays. Consider the following examples:
{a: [1, 2]}
a = [ 1, 2 ]
a = [ 1, 2 ]
{a: [1.0, 2]}
a = [ 1, 2 ]
a = [ 1, 2 ]
{a: [1.1, 2]}
a = [ 1.1, 2 ]
a = [ 1.1, 2.0 ]
{a: [1.1, 2n]}
a = [1.1, 2 ]
a = [ 1.1, 2.0 ]
{a: [1.1, 9999999999999999n]}
a = [ 1.1, 9_999_999_999_999_999 ]
a = [ 1.1, 9_999_999_999_999_999.0 ]
So my thinking:
The text was updated successfully, but these errors were encountered: