W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Re: [DOMCore] fire and dispatch

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 02 Mar 2011 09:46:41 -0500
Message-ID: <4D6E5851.5050306@mit.edu>
To: Jonas Sicking <jonas@sicking.cc>
CC: Anne van Kesteren <annevk@opera.com>, Ojan Vafai <ojan@chromium.org>, Aaron Boodman <aa@chromium.org>, Garrett Smith <dhtmlkitchen@gmail.com>, WebApps WG <public-webapps@w3.org>
On 3/2/11 5:52 AM, Jonas Sicking wrote:
> I'm not quite sure what you mean by "via JSON" given that JSON is a
> serialization format.

The idea would be to take the input object, sanitize it by doing

   obj = JSON.parse(JSON.serialize(obj));

(which will get rid of crud like getters), and then work with it.

> 1. Don't allow getters, i.e. if the object contains any getters, throw
> an exception

This seems like the simplest solution.

> 2. Run getters and define in which order they are retrieved

This can get pretty hard to specify (esp. because it involves describing 
what happens if those getters reenter the API you're defining).

> 3. Treat getters as undefined

That doesn't seem like a good idea to me, honestly.

Received on Wednesday, 2 March 2011 14:47:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:16 UTC