Douglas Crockford wrote: > > I think the hazard is very real and very serious. > > I don't see any additional expressiveness enabled by toJSONString. > > No one is more concerned about the security of the platform than I am. > There isn't a security issue here. The hazard, if there is one, is > certainly not serious. > > This is a convenience issue. Having toJSONString as a builtin is a > convenience, removing the need to load json.js. > Why not override the toString method? Object.prototype.toString(type) { if (type == "json") { // return a json serialisation } else { // return the usual string conversion } }; That way legacy browsers can also support JSON serialisation without breaking "for in" enumeration. -deanReceived on Friday, 3 November 2006 10:05:46 UTC
This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:49 UTC