Lines Matching refs:port2
8 const { port1, port2 } = new MessageChannel();
10 assert(port2 instanceof MessagePort);
14 port2.on('message', common.mustCall((received) => {
16 port2.close(common.mustCall());
21 const { port2 } = new MessageChannel();
22 port2.addEventListener('foo', common.mustCall((received) => {
26 port2.on('foo', common.mustCall((received) => {
29 port2.emit('foo', 'bar');
32 const { port1, port2 } = new MessageChannel();
38 port2.close(common.mustCall());
43 port2.onmessage = common.mustCall((message) => {
44 port2.postMessage(message.data * 2);
49 const { port1, port2 } = new MessageChannel();
53 // Check that the message still gets delivered if `port2` has its
56 port2.on('message', common.mustCall((received) => {
58 port2.close(common.mustCall());
64 const { port1, port2 } = new MessageChannel();
69 // Check that the message still gets delivered if `port2` has its
72 port2.addListener('message', dummy);
74 port2.removeListener('message', dummy);
77 port2.on('message', common.mustCall((received) => {
79 port2.close(common.mustCall());
86 const { port1, port2 } = new MessageChannel();
87 port2.on('message', common.mustCall(6));
131 const { port1, port2 } = new MessageChannel();
132 port2.on('message', common.mustCall((msg) => {
169 c1.port1.postMessage({ port: c2.port2 }, [ c2.port2 ]);
170 c1.port2.addEventListener('message', common.mustCall((ev) => {