W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

Re: [WebIDL] toJSON

From: David Bruant <bruant.d@gmail.com>
Date: Thu, 31 May 2012 10:26:02 +0200
Message-ID: <4FC72B1A.4010908@gmail.com>
To: Simon Pieters <simonp@opera.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
Le 31/05/2012 09:47, Simon Pieters a écrit :
> On Wed, 30 May 2012 19:30:43 +0200, David Bruant <bruant.d@gmail.com> 
> wrote:
>
>> Hi,
>>
>> My reading of the current state of the spec is that
>> JSON.stringify(anyEvent) is '{}' which is close to useless.
>
> Why can't we change JSON.stringify() to make it not useless instead of 
> sprinkling toJSON on everything?
JSON.stringify is part of ECMAScript 5 is widely deployed and used all 
over the place. I'm not against the idea of changing it upfront, but how 
do you do that without introducing backward-compat issue?

Adding a toJSON seems to be less intrusive.

David
Received on Thursday, 31 May 2012 08:26:41 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC