[whatwg] reply() extension to postMessage()

Jeff Walden jwalden+whatwg at MIT.EDU
Tue Feb 19 04:50:47 PST 2008


Ian Hickson wrote:
>> ...this behavior could cause some somewhat nasty infinite recursion. So 
>> what if we made reply() asynchronous so that the the reply message event 
>> doesn't need to be dispatched on the original message posting document 
>> until after the original postMessage from the sender is finished 
>> processing?
> 
> This problem exists today with postMessage() too. Do people think we 
> should go fully asynchronous?

Frankly, I'm not all that worried about someone accidentally triggering infinite recursion; it's easy enough to detect (by the error that's hit?  I don't know IE/Opera behaviors here), and setTimeout is easy enough to use.

I think I favor sync postMessage over async because async capabilities are a strict subset of sync capabilities.  You can always use setTimeout with the sync model to get async behavior; if the model is async you can't replicate sync behavior.

Jeff



More information about the whatwg mailing list