Bug 1370368 - Fix some JSDocs draft
authorRob Wu <rob@robwu.nl>
Wed, 23 May 2018 15:41:26 +0200
changeset 798806 f761b8742d18d839773f889526395e790946fada
parent 798805 8fcf0ff2e2220106261c90ee32fa8482542e2ab2
push id110842
push userbmo:rob@robwu.nl
push dateWed, 23 May 2018 13:45:40 +0000
bugs1370368, 1356546
milestone62.0a1
Bug 1370368 - Fix some JSDocs (not related to the bug, should have been part of bug 1356546) MozReview-Commit-ID: GKAFfdpknt4
toolkit/components/extensions/ExtensionChild.jsm
--- a/toolkit/components/extensions/ExtensionChild.jsm
+++ b/toolkit/components/extensions/ExtensionChild.jsm
@@ -225,18 +225,19 @@ class Port {
   }
 
   /**
    * Register a callback that is called when the port is disconnected by the
    * *other* end. The callback is automatically unregistered when the port or
    * context is closed.
    *
    * @param {function} callback Called when the other end disconnects the port.
-   *     If the disconnect is caused by an error, the first parameter is an
-   *     object with a "message" string property that describes the cause.
+   *        If the disconnect is caused by an error, the first parameter is a
+   *        StructuredCloneHolder, which holds an object with a "message"
+   *        string property that describes the cause.
    * @returns {function} Function to unregister the listener.
    */
   registerOnDisconnect(callback) {
     let listener = error => {
       if (this.context.active) {
         callback(error);
       }
     };
@@ -324,18 +325,18 @@ class Port {
     }
     this.context.forgetOnClose(this);
     this.disconnected = true;
   }
 
   /**
    * Disconnect the port from the other end (which may not even exist).
    *
-   * @param {Error|{message: string}} [error] The reason for disconnecting,
-   *     if it is an abnormal disconnect.
+   * @param {StructuredCloneHolder<Error|{message: string}>} [error]
+   *        The reason for disconnecting, if it is an abnormal disconnect.
    */
   disconnectByOtherEnd(error = null) {
     if (this.disconnected) {
       return;
     }
 
     for (let listener of this.disconnectListeners) {
       listener(error);
@@ -344,17 +345,17 @@ class Port {
 
     this.handleDisconnection();
   }
 
   /**
    * Disconnect the port from this end.
    *
    * @param {Error|{message: string}} [error] The reason for disconnecting,
-   *     if it is an abnormal disconnect.
+   *        if it is an abnormal disconnect.
    * @param {boolean} [keepDisconnectListener] Whether to keep the onDisconnect
    *        listeners, so that they can be called later.
    */
   disconnect(error = null, keepDisconnectListener = false) {
     if (!keepDisconnectListener) {
       this.disconnectListeners.clear();
     }
     if (this.disconnected) {