- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Wed, 09 Jul 2014 12:25:18 -0400
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- CC: Robin Berjon <robin@w3.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On 7/9/14, 12:18 PM, Tab Atkins Jr. wrote:
> And note that just defining a toJSON() method on the object already
> lets you hook JSON.stringify()
Right, but my point is that you still have to define what the toJSON
will do.
With "serializer = { attribute };" (possibly with simpler syntax!) you
automatically get a toJSON with the behavior everyone would typically
expect toJSON to have here. There's value in having that shortcut so
spec authors do not have to reinvent that wheel in prose.
-Boris
Received on Wednesday, 9 July 2014 16:25:46 UTC