[whatwg] JSON encoding

----- Original Message ----- 
From: "Lachlan Hunt" <lachlan.hunt@lachy.id.au>
To: "Douglas Crockford" <douglas at crockford.com>
Cc: <whatwg at whatwg.org>
Sent: Friday, November 03, 2006 10:16 AM
Subject: Re: [whatwg] JSON encoding


| Douglas Crockford wrote:
| >> I think the hazard is very real and very serious.
| >> I don't see any additional expressiveness enabled by toJSONString.
| >
| > This is a convenience issue. Having toJSONString as a builtin is a
| > convenience, removing the need to load json.js.
|
| How is toJSONString() any different from toSource()?
|
| 
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object:toSource
|

JSON ( http://json.org/ ) is a limited set of JS (literals).
toSource does not work in almost all cases related to object serialization.

In particular this
   { one:1 }
is not valid in JSON but this
  { "one":1 }
is acceptable.


Andrew Fedoniouk.
http://terrainformatica.com

Received on Friday, 3 November 2006 11:31:39 UTC