Bug 1278733: Follow-up: Fix JSDoc errors in the subprocess module. r=bustage
authorKris Maglione <maglione.k@gmail.com>
Wed, 08 Jun 2016 12:34:23 -0700
changeset 301155 4c902c5433c7c10b07b302ec856b4789a2fef65d
parent 301154 8c8ac2b6adbd574b0930dc97d17932224b7dc604
child 301156 ded915ec401f6690c95486a68ac2546806aa3227
push id30327
push usercbook@mozilla.com
push dateThu, 09 Jun 2016 09:57:24 +0000
treeherdermozilla-central@f8bdceb55c9d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1278733
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1278733: Follow-up: Fix JSDoc errors in the subprocess module. r=bustage MozReview-Commit-ID: 2NYydGYh0Xu
toolkit/modules/subprocess/Subprocess.jsm
toolkit/modules/subprocess/subprocess_common.jsm
toolkit/modules/subprocess/subprocess_shared.js
toolkit/modules/subprocess/subprocess_worker_common.js
toolkit/modules/subprocess/subprocess_worker_unix.js
toolkit/modules/subprocess/subprocess_worker_win.js
--- a/toolkit/modules/subprocess/Subprocess.jsm
+++ b/toolkit/modules/subprocess/Subprocess.jsm
@@ -138,17 +138,17 @@ var Subprocess = {
    * Searches for the given executable file in the system executable
    * file paths as specified by the PATH environment variable.
    *
    * On Windows, if the unadorned filename cannot be found, the
    * extensions in the semicolon-separated list in the PATHSEP
    * environment variable are successively appended to the original
    * name and searched for in turn.
    *
-   * @param {string} bin
+   * @param {string} command
    *        The name of the executable to find.
    * @param {object} [environment]
    *        An object containing a key for each environment variable to be used
    *        in the search. If not provided, full the current process environment
    *        is used.
    * @returns {Promise<string>}
    */
   pathSearch(command, environment = this.getEnvironment()) {
--- a/toolkit/modules/subprocess/subprocess_common.jsm
+++ b/toolkit/modules/subprocess/subprocess_common.jsm
@@ -327,16 +327,18 @@ class InputPipe extends Pipe {
         }
       }
     });
   }
 
   /**
    * Adds the given data to the end of the input buffer.
    *
+   * @param {ArrayBuffer} buffer
+   *        An input buffer to append to the current buffered input.
    * @private
    */
   onInput(buffer) {
     this.buffers.push(buffer);
     this.dataAvailable += buffer.byteLength;
     this.checkPendingReads();
   }
 
--- a/toolkit/modules/subprocess/subprocess_shared.js
+++ b/toolkit/modules/subprocess/subprocess_shared.js
@@ -5,16 +5,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 /* exported Library, SubprocessConstants */
 
 if (!ArrayBuffer.transfer) {
   /**
    * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/transfer
+   *
+   * @param {ArrayBuffer} buffer
+   * @param {integer} [size = buffer.byteLength]
+   * @returns {ArrayBuffer}
    */
   ArrayBuffer.transfer = function(buffer, size = buffer.byteLength) {
     let u8out = new Uint8Array(size);
     let u8buffer = new Uint8Array(buffer, 0, Math.min(size, buffer.byteLength));
 
     u8out.set(u8buffer);
 
     return u8out.buffer;
--- a/toolkit/modules/subprocess/subprocess_worker_common.js
+++ b/toolkit/modules/subprocess/subprocess_worker_common.js
@@ -63,17 +63,17 @@ class BaseProcess {
 
   /**
    * Creates a null-terminated array of pointers to null-terminated C-strings,
    * and returns it.
    *
    * @param {string[]} strings
    *        The strings to convert into a C string array.
    *
-   * @returns {ctypes.char.ptr.array()}
+   * @returns {ctypes.char.ptr.array}
    */
   stringArray(strings) {
     let result = ctypes.char.ptr.array(strings.length + 1)();
 
     let cstrings = strings.map(str => ctypes.char.array()(str));
     for (let [i, cstring] of cstrings.entries()) {
       result[i] = cstring;
     }
--- a/toolkit/modules/subprocess/subprocess_worker_unix.js
+++ b/toolkit/modules/subprocess/subprocess_worker_unix.js
@@ -275,16 +275,18 @@ class Process extends BaseProcess {
     libc.kill(this.pid, signal);
     this.wait();
   }
 
   /**
    * Initializes the IO pipes for use as standard input, output, and error
    * descriptors in the spawned process.
    *
+   * @param {object} options
+   *        The Subprocess options object for this process.
    * @returns {unix.Fd[]}
    *          The array of file descriptors belonging to the spawned process.
    */
   initPipes(options) {
     let stderr = options.stderr;
 
     let our_pipes = [];
     let their_pipes = new Map();
--- a/toolkit/modules/subprocess/subprocess_worker_win.js
+++ b/toolkit/modules/subprocess/subprocess_worker_win.js
@@ -377,31 +377,38 @@ class Process extends BaseProcess {
 
     this.pipes = our_pipes;
 
     return their_pipes;
   }
 
   /**
    * Creates a null-separated, null-terminated string list.
+   *
+   * @param {Array<string>} strings
+   * @returns {win32.WCHAR.array}
    */
   stringList(strings) {
     // Remove empty strings, which would terminate the list early.
     strings = strings.filter(string => string);
 
     let string = strings.join("\0") + "\0\0";
 
     return win32.WCHAR.array()(string);
   }
 
   /**
    * Quotes a string for use as a single command argument, using Windows quoting
    * conventions.
    *
    * @see https://msdn.microsoft.com/en-us/library/17w5ykft(v=vs.85).aspx
+   *
+   * @param {string} str
+   *        The argument string to quote.
+   * @returns {string}
    */
   quoteString(str) {
     if (!/[\s"]/.test(str)) {
       return str;
     }
 
     let escaped = str.replace(/(\\*)("|$)/g, (m0, m1, m2) => {
       if (m2) {