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

RE: [WebIDL] toJSON

From: Travis Leithead <travis.leithead@microsoft.com>
Date: Wed, 30 May 2012 19:40:59 +0000
To: David Bruant <bruant.d@gmail.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <9768D477C67135458BF978A45BCF9B383836C321@TK5EX14MBXW604.wingroup.windeploy.ntdev.microsoft.com>
IE9 added a native toJSON method on the window.performance object in order to allow simple JSON of that accessor property to work nicely :)

Could be really nice to add a WebIDL syntax supporting this generally, such as how "stringifier;" is supported today.

> -----Original Message-----
> From: David Bruant [mailto:bruant.d@gmail.com]
> Sent: Wednesday, May 30, 2012 10:31 AM
> To: public-script-coord@w3.org
> Subject: [WebIDL] toJSON
> 
> Hi,
> 
> My reading of the current state of the spec is that
> JSON.stringify(anyEvent) is '{}' which is close to useless. This is true for any
> WebIDL compliant object.
> ECMAScript 5 introduced JSON and the toJSON property. Could it be considered
> to make something useful out of WebIDL compliant objects using this property?
> 
> David
> 
Received on Wednesday, 30 May 2012 19:41:40 UTC

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