According to current HTML5 text, a close event should be dispatched to MessagePorts whose entangled ports belong to a document that is being destructed. This causes crashes for us in some circumstances, because the document can be destroyed from the same GC run that destroys ports and their event listeners. But also, this requirement is logically incorrect, because it makes behavior depend on GC order in some cases. This has not been resolved in HTML5 yet, but I want to fix the crash anyway. Patch forthcoming.
Created attachment 25091 [details] proposed fix
Comment on attachment 25091 [details] proposed fix r=me
Committed revision 38366.