NS_PRECONDITION(nsnull != aException, "null ptr"); if (nsnull == aException) { return NS_ERROR_NULL_POINTER; }
*aException = new nsDOMException(aNSResult, aDefaultException); NS_ENSURE_TRUE(*aException, NS_ERROR_OUT_OF_MEMORY);
NS_NewDOMException(nsIDOMDOMException** aException,                   nsresult aResult,                    const char* aName,                    const char* aMessage,                   const char* aLocation){  NS_PRECONDITION(nsnull != aException, "null ptr");  if (nsnull == aException) {    return NS_ERROR_NULL_POINTER;  }  nsDOMException* it = new nsDOMException(aResult,                                          aName,                                          aMessage,                                          aLocation);  if (nsnull == it) {    return NS_ERROR_OUT_OF_MEMORY;  }    return it->QueryInterface(NS_GET_IID(nsIDOMDOMException),                            (void**)aException);}