<div class="gmail_quote">On Thu, Mar 11, 2010 at 10:12 AM, Mikko Rantalainen <span dir="ltr"><<a href="mailto:mikko.rantalainen@peda.net">mikko.rantalainen@peda.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">timeless wrote:<br>
> On Tue, Mar 2, 2010 at 12:50 AM, ben turner <<a href="mailto:bent@mozilla.com">bent@mozilla.com</a>> wrote:<br>
</div><div class="im">>> - If input is a host object (e.g. a DOM node)<br>
>> Return the null value.<br>
><br>
</div><div class="im">> The general reason, I believe for this behavior is if you have:<br>
><br>
> a=[x,y,z,q,r,s]; worker.postMessage(a) and r turns out to be window,<br>
> you don't want to trigger an exception just because one value in a<br>
> list is a native object.<br>
<br>
</div>Why do you think so? I'd expect an exception instead of potential data<br>
loss (due to not being to able to post the actual data to the worker).<br>
I'd be happy to filter the "r" out of the list if I need to, but I'd<br>
hate to try to figure why *some* of the data I was posting does not show<br>
up at the worker. Obviously, if I know that I cannot post "r" and I<br>
don't want to do the filtering myself, it would be nice to have an extra<br>
parameter for postMessage() telling that it's okay to drop some data if<br>
it cannot be transferred but that should not be the default. However, I<br>
would consider that a special case and API could do just fine without<br>
such feature.<br></blockquote><div><br></div><div>FWIW, I'd have to agree that throwing an exception when there's something that can't be completely serialized makes sense, but I haven't been following structured clone discussions, so I don't know whether this has come up before and if there was a good reason for what's currently being done.</div>
</div>