On Wed, May 25, 2011 at 10:52 PM, Aaron Jacobs <email@example.com>
Hmm, but does it make sense to say a default constructed value is all
of null, an array, and an object? Wouldn't it make more sense to have
In JS, default-constructed values are 'undefined', not null:
Rhino 1.7 release 2 2010 11 17
js> var x; print(typeof x);
(And (typeof null) == object, for some brain-dead reason or other.)
IMO that is the proper default-construction semantics. The further a JSON impl deviates from basic JS behaviours, the less portable it is likely to become.
isArray (and only isArray) start returning true once the value is
"turned into" an array by appending something to it?
Using JS as a baseline:
js> x = 3;
that's the behaviour most would expect, i think (as opposed to automatic promotion to an Array or Object).