function dispatchOnDisconnect(portId, errorMessage) {
    var port = ports[portId];
    if (port) {
      delete ports[portId];
      if (errorMessage)
        setLastError('Port', errorMessage);
      try {
        port.onDisconnect.dispatch(port);
      } finally {
        privates(port).impl.destroy_();
        clearLastError();
      }
    }
  }
// Called by native code when a channel has been closed.
Called by native code when a channel has been closed.
Called by native code when a channel has been closed .
function dispatchOnDisconnect(portId, errorMessage) {
    var port = ports[portId];
    if (port) {
      delete ports[portId];
      if (errorMessage)
        setLastError('Port', errorMessage);
      try {
        port.onDisconnect.dispatch(port);
      } finally {
        privates(port).impl.destroy_();
        clearLastError();
      }
    }
  }
function dispatchOnDisconnect ( portId , errorMessage ) { var port = ports [ portId ] ; if ( port ) { delete ports [ portId ] ; if ( errorMessage ) setLastError ( 'Port' , errorMessage ) ; try { port . onDisconnect . dispatch ( port ) ; } finally { privates ( port ) . impl . destroy_ ( ) ; clearLastError ( ) ; } } }
Called by native code when a channel has been closed.
Called by native code when a channel has been closed .