Open iarna opened 4 years ago
The only thing that makes me feel icky about the change to 4 is that the following:
TOML.stringify(TOML.parse('a = [ 1.1, 2 ]'`)) === 'a = [ 1.1, 2.0 ]'
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: