gecko-dev/dom/messagechannel/tests/sharedWorker2_messageChanne...

8 строки
158 B
JavaScript

var mc = new MessageChannel();
var i = 0;
onconnect = function(evt) {
dump("CONNECTING: "+ i +"\n");
evt.ports[0].postMessage(42, [mc['port' + ++i]]);
}