B2G/gecko/toolkit/components/osfile/osfile_unix_front.jsm
/**
      * Utility function to sort errors represented as "-1" from successes.
      *
      * @param {number} result The result of the operation that may
      * represent either an error or a success. If -1, this function raises
      * an error holding ctypes.errno, otherwise it returns |result|.
      * @param {string=} operation The name of the operation. If unspecified,
      * the name of the caller function.
      */
Utility function to sort errors represented as "-1" from successes.
@param {number} result The result of the operation that may
represent either an error or a success. If -1, this function raises
an error holding ctypes.errno, otherwise it returns |result|.
@param {string=} operation The name of the operation. If unspecified,
the name of the caller function.
Utility function to sort errors represented as " - 1 " from successes . @param { number } result The result of the operation that may represent either an error or a success . If - 1 this function raises an error holding ctypes . errno otherwise it returns |result| . @param { string = } operation The name of the operation . If unspecified the name of the caller function .
function throw_on_negative(operation, result) {
       if (result < 0) {
         throw new File.Error(operation);
       }
       return result;
     }
function throw_on_negative ( operation , result ) { if ( result < 0 ) { throw new File . Error ( operation ) ; } return result ; }
Utility function to sort errors represented as "-1" from successes.
Utility function to sort errors represented as " - 1 " from successes .