summaryrefslogtreecommitdiffstats
path: root/dom/messagechannel/tests/sharedWorker_messageChannel.js
blob: 4b24642f9d26ebabecd7526943e5cf76bc2e45ff (plain)
1
2
3
4
5
6
7
8
onconnect = function(evt) {
  var mc = new MessageChannel();

  evt.ports[0].postMessage(42, [mc.port2]);
  mc.port1.onmessage = function(e) {
    mc.port1.postMessage(e.data);
  }
}