W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2010

[whatwg] Structured clone algorithm a little too friendly?

From: Mikko Rantalainen <mikko.rantalainen@peda.net>
Date: Thu, 11 Mar 2010 12:12:15 +0200
Message-ID: <4B98C1FF.9070607@peda.net>
timeless wrote:
> On Tue, Mar 2, 2010 at 12:50 AM, ben turner <bent at mozilla.com> wrote:
>>  - If input is a host object (e.g. a DOM node)
>>      Return the null value.
> The general reason, I believe for this behavior is if you have:
> a=[x,y,z,q,r,s]; worker.postMessage(a) and r turns out to be window,
> you don't want to trigger an exception just because one value in a
> list is a native object.

Why do you think so? I'd expect an exception instead of potential data
loss (due to not being to able to post the actual data to the worker).
I'd be happy to filter the "r" out of the list if I need to, but I'd
hate to try to figure why *some* of the data I was posting does not show
up at the worker. Obviously, if I know that I cannot post "r" and I
don't want to do the filtering myself, it would be nice to have an extra
parameter for postMessage() telling that it's okay to drop some data if
it cannot be transferred but that should not be the default. However, I
would consider that a special case and API could do just fine without
such feature.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100311/b1ca6956/attachment.pgp>
Received on Thursday, 11 March 2010 02:12:15 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:21 UTC