B2G/gecko/netwerk/test/httpserver/test/head_utils.js
/**
 * Checks that the exception e (which may be an XPConnect-created exception
 * object or a raw nsresult number) is the given nsresult.
 *
 * @param e : Exception or nsresult
 *   the actual exception
 * @param code : nsresult
 *   the expected exception
 */
Checks that the exception e (which may be an XPConnect-created exception
object or a raw nsresult number) is the given nsresult.

@param e : Exception or nsresult
the actual exception
@param code : nsresult
the expected exception
Checks that the exception e ( which may be an XPConnect - created exception object or a raw nsresult number ) is the given nsresult . @param e : Exception or nsresult the actual exception @param code : nsresult the expected exception
function isException(e, code)
{
  if (e !== code && e.result !== code)
    do_throw("unexpected error: " + e);
}
function isException ( e , code ) { if ( e !== code && e . result !== code ) do_throw ( "unexpected error: " + e ) ; }
Checks that the exception e (which may be an XPConnect-created exception
 object or a raw nsresult number) is the given nsresult.
Checks that the exception e ( which may be an XPConnect - created exception object or a raw nsresult number ) is the given nsresult .