This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In Step 4.2 of http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#dom-messageport-postmessage, user agents are required to throw a DataCloneError if the "target" port (that which will receive this message) is passed in the transfer argument. This is a well-meaning requirement, since there's no way to make sense of such a postMessage call, but in multi-process, multi-threaded user agents it can be difficult-to-impossible to determine what is at the remote end of a MessagePort. See https://code.google.com/p/chromium/issues/detail?id=312962, which includes a test case that fails to throw on both Chrome and Safari. An alternative would be to remove the throwing requirement and replace it with an async requirement to abort the process and optionally log a console message.
A halfway proposal would also allow user agents than can synchronously detect this error condition to throw.
I think we want it to be consistent for all cases. So, no throwing, but throw a console message once you realise it's a lost cause. Maybe once we add a way to detect that the other side has died unexpectedly, we can make this be one of those cases, too.
Blink has stopped throwing in this case as of http://src.chromium.org/viewvc/blink?view=revision&revision=161083 (cc Jonas so he can route appropriately at Mozilla, I believe they're currently working on implementing MessagePort transferring)
Checked in as WHATWG revision r8306. Check-in comment: People apparently don't like it when the spec requires things that are impossible to implement, go figure. (In this case, synchronously detecting that one of the MessagePorts being Transferred in the MessagePort message is actually the target of the message. You can't necessarily know this synchronously, since if the port has been shunted around between workers, you might only discover who the final target actually is after the message has itself bounced between threads for a while.) http://html5.org/tools/web-apps-tracker?from=8305&to=8306