As of version 2.8.0, browser native
In versions prior to 2.8, the signature and behavior of
differed slightly from the reference implementation at JSON.org and the ECMAScript version 5 specification that grew from that. In order to leverage native methods as browsers adopt the ECMAScript 5 spec, the YUI implementation of
had to change so the behavior would be consistent across browsers with and without native JSON support.
behavior that has changed from 2.7.0 to 2.8.0 is:
Cyclical object references are no longer replaced with
, but now throw an Error. It is therefore recommended to wrap both
The third parameter no longer limits the depth of object serialization, but is now used to trigger formatted output.
Objects with a
method will be first transformed using this method.
Object keys are no longer sorted alphabetically. This is possible to do with a replacer function.
is no longer recommended because the default ISO 8601 serialization is defined in the spec. If Dates must be formatted differently, either preprocess the data or set