Bug 489502 - Replace NS_ASSERTION(0, ...) by NS_ERROR(...) in mozilla-central; r=benjamin
authorHashem Masoud <wraithlike@gmail.com>
Fri, 14 Aug 2009 16:09:00 +0200
changeset 31561 953c281e9223a520c433a155a70cbd7ef30e2936
parent 31560 40ed0ff134205aef5c6d777b8801ca6bd4ec9101
child 31562 2a152f11d9c7a25c70c8d6614aec2a43cb660187
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbenjamin
bugs489502
milestone1.9.3a1pre
Bug 489502 - Replace NS_ASSERTION(0, ...) by NS_ERROR(...) in mozilla-central; r=benjamin
content/canvas/src/nsCanvasRenderingContext2D.cpp
content/xslt/src/xml/txAttr.cpp
content/xslt/src/xml/txDOM.h
content/xslt/src/xml/txNodeDefinition.cpp
content/xslt/src/xpath/txFunctionCall.cpp
content/xslt/src/xslt/txCurrentFunctionCall.cpp
content/xslt/src/xslt/txXSLTPatterns.cpp
db/mork/src/morkConfig.cpp
editor/libeditor/html/nsHTMLDataTransfer.cpp
editor/txtsvc/src/nsTextServicesDocument.cpp
embedding/browser/activex/src/common/ControlSite.cpp
embedding/browser/activex/src/common/IEHtmlElementCollection.cpp
embedding/browser/activex/src/common/IEHtmlNode.cpp
embedding/browser/activex/src/common/IWebBrowserImpl.h
embedding/components/commandhandler/src/nsCommandParams.h
gfx/src/thebes/nsThebesDeviceContext.cpp
gfx/thebes/src/gfxFT2Fonts.cpp
intl/locale/src/os2/nsCollationOS2.cpp
intl/locale/src/unix/nsCollationUnix.cpp
intl/strres/src/nsStringBundleTextOverride.cpp
intl/uconv/src/nsUNIXCharset.cpp
intl/uconv/util/nsUCSupport.cpp
js/jsd/jsd_xpc.cpp
js/src/xpconnect/src/XPCDispObject.cpp
js/src/xpconnect/src/xpcconvert.cpp
js/src/xpconnect/src/xpcjsid.cpp
js/src/xpconnect/src/xpcthreadcontext.cpp
js/src/xpconnect/src/xpcwrappednative.cpp
js/src/xpconnect/src/xpcwrappednativeinfo.cpp
js/src/xpconnect/tests/TestXPC.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/forms/nsTextControlFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsSelection.cpp
layout/mathml/nsMathMLmpaddedFrame.cpp
modules/plugin/base/src/nsNPAPIPlugin.cpp
security/manager/ssl/src/nsCipherInfo.cpp
security/manager/ssl/src/nsCrypto.cpp
security/manager/ssl/src/nsNSSASN1Object.cpp
security/manager/ssl/src/nsNSSCertHelper.cpp
security/manager/ssl/src/nsNSSCertificate.cpp
security/manager/ssl/src/nsNSSCertificateDB.cpp
toolkit/components/downloads/src/nsDownloadManager.cpp
widget/src/beos/nsWindow.cpp
widget/src/cocoa/nsChildView.mm
widget/src/cocoa/nsCocoaWindow.mm
widget/src/cocoa/nsFilePicker.mm
widget/src/cocoa/nsToolkit.mm
widget/src/os2/nsDragService.cpp
widget/src/os2/nsWindow.cpp
widget/src/photon/nsWidget.cpp
widget/src/windows/nsFilePicker.cpp
widget/src/windows/nsWindow.cpp
widget/src/windows/nsWindowCE.cpp
xpcom/base/nsMemoryImpl.cpp
xpcom/components/nsComponentManager.cpp
xpcom/obsolete/nsFileSpec.cpp
xpcom/obsolete/nsFileSpecImpl.cpp
xpcom/obsolete/nsFileSpecOS2.cpp
xpcom/obsolete/nsFileSpecWin.cpp
xpcom/reflect/xptcall/src/md/os2/xptcstubs_gcc_x86_os2.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_alpha_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ipf32.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ipf64.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_irix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390x.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_arm.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_shle.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_openvms_alpha.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_osf1_alpha.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_aix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_aix64.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_netbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_rhapsody.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparcv9_solaris.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.cpp
xpcom/reflect/xptcall/src/md/win32/xptcstubs.cpp
xpcom/reflect/xptcall/src/md/win32/xptcstubs_alpha.cpp
xpcom/reflect/xptcall/src/md/win32/xptcstubs_x86_64.cpp
xpcom/reflect/xptcall/src/md/win32/xptcstubsce.cpp
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -2028,17 +2028,17 @@ nsCanvasRenderingContext2D::GetTextAlign
         break;
     case TEXT_ALIGN_RIGHT:
         ta.AssignLiteral("right");
         break;
     case TEXT_ALIGN_CENTER:
         ta.AssignLiteral("center");
         break;
     default:
-        NS_ASSERTION(0, "textAlign holds invalid value");
+        NS_ERROR("textAlign holds invalid value");
         return NS_ERROR_FAILURE;
     }
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCanvasRenderingContext2D::SetTextBaseline(const nsAString& tb)
@@ -2081,17 +2081,17 @@ nsCanvasRenderingContext2D::GetTextBasel
         break;
     case TEXT_BASELINE_IDEOGRAPHIC:
         tb.AssignLiteral("ideographic");
         break;
     case TEXT_BASELINE_BOTTOM:
         tb.AssignLiteral("bottom");
         break;
     default:
-        NS_ASSERTION(0, "textBaseline holds invalid value");
+        NS_ERROR("textBaseline holds invalid value");
         return NS_ERROR_FAILURE;
     }
 
     return NS_OK;
 }
 
 /*
  * Helper function that replaces the whitespace characters in a string
@@ -2360,17 +2360,17 @@ nsCanvasRenderingContext2D::DrawOrMeasur
         break;
     case TEXT_BASELINE_IDEOGRAPHIC:
         anchorY = 0; // currently unvailable
         break;
     case TEXT_BASELINE_BOTTOM:
         anchorY = -fontMetrics.emDescent;
         break;
     default:
-        NS_ASSERTION(0, "mTextBaseline holds invalid value");
+        NS_ERROR("mTextBaseline holds invalid value");
         return NS_ERROR_FAILURE;
     }
 
     processor.mPt.y += anchorY;
 
     // correct bounding box to get it to be the correct size/position
     processor.mBoundingBox.size.width = totalWidth;
     processor.mBoundingBox.MoveBy(processor.mPt);
--- a/content/xslt/src/xml/txAttr.cpp
+++ b/content/xslt/src/xml/txAttr.cpp
@@ -55,17 +55,17 @@ Attr::Attr(nsIAtom *aPrefix, nsIAtom *aL
 {
 }
 
 //
 //Not implemented anymore, return null as an error.
 //
 Node* Attr::appendChild(Node* newChild)
 {
-  NS_ASSERTION(0, "not implemented");
+  NS_ERROR("not implemented");
   return nsnull;
 }
 
 nsresult
 Attr::getNodeName(nsAString& aName) const
 {
   if (mPrefix) {
     mPrefix->ToString(aName);
--- a/content/xslt/src/xml/txDOM.h
+++ b/content/xslt/src/xml/txDOM.h
@@ -390,17 +390,17 @@ public:
             return kNameSpaceID_Unknown;
 
         PRInt32 id = mNamespaces->IndexOf(aURI);
         if (id != -1) {
             return id + 1;
         }
 
         if (!mNamespaces->AppendString(aURI)) {
-            NS_ASSERTION(0, "Out of memory, namespaces are getting lost");
+            NS_ERROR("Out of memory, namespaces are getting lost");
             return kNameSpaceID_Unknown;
         }
 
         return mNamespaces->Count();
     }
 
     static nsresult getNamespaceURI(const PRInt32 aID, nsAString& aNSURI)
     {
--- a/content/xslt/src/xml/txNodeDefinition.cpp
+++ b/content/xslt/src/xml/txNodeDefinition.cpp
@@ -359,17 +359,17 @@ NodeDefinition::OrderInfo* NodeDefinitio
         }
         ++i;
         child = child->getNextSibling();
       }
       break;
     }
   }
 
-  NS_ASSERTION(0, "unable to get childnumber");
+  NS_ERROR("unable to get childnumber");
   mOrderInfo->mOrder[lastElem] = 0;
   return mOrderInfo;
 }
 
 /*
  * OrderInfo destructor
  */
 NodeDefinition::OrderInfo::~OrderInfo()
--- a/content/xslt/src/xpath/txFunctionCall.cpp
+++ b/content/xslt/src/xpath/txFunctionCall.cpp
@@ -140,17 +140,17 @@ FunctionCall::argsSensitiveTo(ContextSen
 #ifdef TX_TO_STRING
 void
 FunctionCall::toString(nsAString& aDest)
 {
     nsCOMPtr<nsIAtom> functionNameAtom;
     nsAutoString functionName;
     if (NS_FAILED(getNameAtom(getter_AddRefs(functionNameAtom))) ||
         NS_FAILED(functionNameAtom->ToString(functionName))) {
-        NS_ASSERTION(0, "Can't get function name.");
+        NS_ERROR("Can't get function name.");
         return;
     }
 
     aDest.Append(functionName);
     aDest.Append(PRUnichar('('));
     for (PRUint32 i = 0; i < mParams.Length(); ++i) {
         if (i != 0) {
             aDest.Append(PRUnichar(','));
--- a/content/xslt/src/xslt/txCurrentFunctionCall.cpp
+++ b/content/xslt/src/xslt/txCurrentFunctionCall.cpp
@@ -25,17 +25,17 @@ CurrentFunctionCall::evaluate(txIEvalCon
     *aResult = nsnull;
 
     if (!requireParams(0, 0, aContext))
         return NS_ERROR_XPATH_BAD_ARGUMENT_COUNT;
 
     txExecutionState* es = 
         static_cast<txExecutionState*>(aContext->getPrivateContext());
     if (!es) {
-        NS_ASSERTION(0,
+        NS_ERROR(
             "called xslt extension function \"current\" with wrong context");
         return NS_ERROR_UNEXPECTED;
     }
     return aContext->recycler()->getNodeSet(
            es->getEvalContext()->getContextNode(), aResult);
 }
 
 Expr::ResultType
--- a/content/xslt/src/xslt/txXSLTPatterns.cpp
+++ b/content/xslt/src/xslt/txXSLTPatterns.cpp
@@ -50,17 +50,17 @@
 
 /*
  * Returns the default priority of this Pattern.
  * UnionPatterns don't like this.
  * This should be called on the simple patterns.
  */
 double txUnionPattern::getDefaultPriority()
 {
-    NS_ASSERTION(0, "Don't call getDefaultPriority on txUnionPattern");
+    NS_ERROR("Don't call getDefaultPriority on txUnionPattern");
     return Double::NaN;
 }
 
 /*
  * Determines whether this Pattern matches the given node within
  * the given context
  * This should be called on the simple patterns for xsl:template,
  * but is fine for xsl:key and xsl:number
--- a/db/mork/src/morkConfig.cpp
+++ b/db/mork/src/morkConfig.cpp
@@ -48,17 +48,17 @@
 #endif
 
 //3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
 
 void mork_assertion_signal(const char* inMessage)
 {
 #if defined(MORK_WIN) || defined(MORK_MAC)
   // asm { int 3 }
-  NS_ASSERTION(0, inMessage);
+  NS_ERROR(inMessage);
 #endif /*MORK_WIN*/
 }
 
 #if defined(MORK_OS2)
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <share.h>
 #include <io.h>
--- a/editor/libeditor/html/nsHTMLDataTransfer.cpp
+++ b/editor/libeditor/html/nsHTMLDataTransfer.cpp
@@ -1219,17 +1219,17 @@ nsHTMLEditor::ParseCFHTML(nsCString & aC
       }
       else if (aCfhtml[curPos] == '<') 
       {
           // if we are at the start, then we want to see the '<'
           if (curPos != startFragment) 
           {
               // working backwards, the first thing we see is the start of a tag
               // so StartFragment is bad, so we need to update it.
-              NS_ASSERTION(0, "StartFragment byte count in the clipboard looks bad, see bug #228879");
+              NS_ERROR("StartFragment byte count in the clipboard looks bad, see bug #228879");
               startFragment = curPos - 1;
           }
           break;
       }
       else 
       {
           curPos--;
       }
--- a/editor/txtsvc/src/nsTextServicesDocument.cpp
+++ b/editor/txtsvc/src/nsTextServicesDocument.cpp
@@ -1864,17 +1864,17 @@ nsTextServicesDocument::DeleteNode(nsIDO
       mIteratorStatus != nsTextServicesDocument::eIsDone)
   {
     // XXX: This should never really happen because
     // AdjustContentIterator() should have been called prior
     // to the delete to try and position the iterator on the
     // next valid text node in the offset table, and if there
     // wasn't a next, it would've set mIteratorStatus to eIsDone.
 
-    NS_ASSERTION(0, "DeleteNode called for current iterator node."); 
+    NS_ERROR("DeleteNode called for current iterator node."); 
   }
 
   tcount = mOffsetTable.Length();
 
   while (nodeIndex < tcount)
   {
     entry = mOffsetTable[nodeIndex];
 
@@ -1927,28 +1927,28 @@ nsTextServicesDocument::JoinNodes(nsIDOM
 
   result = aLeftNode->GetNodeType(&type);
 
   if (NS_FAILED(result))
     return PR_FALSE;
 
   if (nsIDOMNode::TEXT_NODE != type)
   {
-    NS_ASSERTION(0, "JoinNode called with a non-text left node!");
+    NS_ERROR("JoinNode called with a non-text left node!");
     return NS_ERROR_FAILURE;
   }
 
   result = aRightNode->GetNodeType(&type);
 
   if (NS_FAILED(result))
     return PR_FALSE;
 
   if (nsIDOMNode::TEXT_NODE != type)
   {
-    NS_ASSERTION(0, "JoinNode called with a non-text right node!");
+    NS_ERROR("JoinNode called with a non-text right node!");
     return NS_ERROR_FAILURE;
   }
 
   // Note: The editor merges the contents of the left node into the
   //       contents of the right.
 
   PRInt32 leftIndex, rightIndex;
   PRBool leftHasEntry, rightHasEntry;
--- a/embedding/browser/activex/src/common/ControlSite.cpp
+++ b/embedding/browser/activex/src/common/ControlSite.cpp
@@ -390,17 +390,17 @@ HRESULT CControlSite::Create(REFCLSID cl
 
 // Attach the created control to a window and activate it
 HRESULT CControlSite::Attach(HWND hwndParent, const RECT &rcPos, IUnknown *pInitStream)
 {
     TRACE_METHOD(CControlSite::Attach);
 
     if (hwndParent == NULL)
     {
-        NS_ASSERTION(0, "No parent hwnd");
+        NS_ERROR("No parent hwnd");
         return E_INVALIDARG;
     }
 
     m_hWndParent = hwndParent;
     m_rcObjectPos = rcPos;
 
     // Object must have been created
     if (m_spObject == NULL)
--- a/embedding/browser/activex/src/common/IEHtmlElementCollection.cpp
+++ b/embedding/browser/activex/src/common/IEHtmlElementCollection.cpp
@@ -100,17 +100,17 @@ HRESULT CIEHtmlElementCollection::Popula
     for (PRUint32 i = 0; i < length; i++)
     {
         // Get the next item from the list
         nsCOMPtr<nsIDOMNode> childNode;
         pNodeList->Item(i, getter_AddRefs(childNode));
         if (!childNode)
         {
             // Empty node (unexpected, but try and carry on anyway)
-            NS_ASSERTION(0, "Empty node");
+            NS_ERROR("Empty node");
             continue;
         }
 
         // Skip nodes representing, text, attributes etc.
         PRUint16 nodeType;
         childNode->GetNodeType(&nodeType);
         if (nodeType != nsIDOMNode::ELEMENT_NODE)
         {
@@ -126,17 +126,17 @@ HRESULT CIEHtmlElementCollection::Popula
     }
     return S_OK;
 }
 
 HRESULT CIEHtmlElementCollection::PopulateFromDOMNode(nsIDOMNode *aDOMNode, BOOL bRecurseChildren)
 {
     if (aDOMNode == nsnull)
     {
-        NS_ASSERTION(0, "No dom node");
+        NS_ERROR("No dom node");
         return E_INVALIDARG;
     }
 
     PRBool hasChildNodes = PR_FALSE;
     aDOMNode->HasChildNodes(&hasChildNodes);
     if (hasChildNodes)
     {
         if (bRecurseChildren)
@@ -191,70 +191,70 @@ HRESULT CIEHtmlElementCollection::Popula
     return S_OK;
 }
 
 
 HRESULT CIEHtmlElementCollection::CreateFromDOMHTMLCollection(CNode *pParentNode, nsIDOMHTMLCollection *pNodeList, CIEHtmlElementCollection **pInstance)
 {
     if (pInstance == NULL || pParentNode == NULL)
     {
-        NS_ASSERTION(0, "No instance or parent node");
+        NS_ERROR("No instance or parent node");
         return E_INVALIDARG;
     }
 
     // Get the DOM node from the parent node
     if (!pParentNode->mDOMNode)
     {
-        NS_ASSERTION(0, "Parent has no DOM node");
+        NS_ERROR("Parent has no DOM node");
         return E_INVALIDARG;
     }
 
     *pInstance = NULL;
 
     // Create a collection object
     CIEHtmlElementCollectionInstance *pCollection = NULL;
     CIEHtmlElementCollectionInstance::CreateInstance(&pCollection);
     if (pCollection == NULL)
     {
-        NS_ASSERTION(0, "Could not create collection");
+        NS_ERROR("Could not create collection");
         return E_OUTOFMEMORY;
     }
 
     // Initialise and populate the collection
     pCollection->SetParent(pParentNode);
     pCollection->PopulateFromDOMHTMLCollection(pNodeList);
 
     *pInstance = pCollection;
 
     return S_OK;
 }
 
 HRESULT CIEHtmlElementCollection::CreateFromParentNode(CNode *pParentNode, BOOL bRecurseChildren, CIEHtmlElementCollection **pInstance)
 {
     if (pInstance == NULL || pParentNode == NULL)
     {
-        NS_ASSERTION(0, "No instance or parent node");
+        NS_ERROR("No instance or parent node");
         return E_INVALIDARG;
     }
 
     // Get the DOM node from the parent node
     if (!pParentNode->mDOMNode)
     {
-        NS_ASSERTION(0, "Parent has no DOM node");
+        NS_ERROR("Parent has no DOM node");
         return E_INVALIDARG;
     }
 
     *pInstance = NULL;
 
     // Create a collection object
     CIEHtmlElementCollectionInstance *pCollection = NULL;
     CIEHtmlElementCollectionInstance::CreateInstance(&pCollection);
     if (pCollection == NULL)
     {
-        NS_ASSERTION(0, "Could not create collection");
+        NS_ERROR("Could not create collection");
         return E_OUTOFMEMORY;
     }
 
     // Initialise and populate the collection
     pCollection->SetParent(pParentNode);
     pCollection->PopulateFromDOMNode(pParentNode->mDOMNode, bRecurseChildren);
 
     *pInstance = pCollection;
@@ -262,17 +262,17 @@ HRESULT CIEHtmlElementCollection::Create
     return S_OK;
 }
 
 
 HRESULT CIEHtmlElementCollection::AddNode(IDispatch *pNode)
 {
     if (pNode == NULL)
     {
-        NS_ASSERTION(0, "No node");
+        NS_ERROR("No node");
         return E_INVALIDARG;
     }
 
     const PRUint32 c_NodeListResizeBy = 100;
 
     if (mNodeList == NULL)
     {
         mNodeListCapacity = c_NodeListResizeBy;
@@ -282,17 +282,17 @@ HRESULT CIEHtmlElementCollection::AddNod
     else if (mNodeListCount == mNodeListCapacity)
     {
         mNodeListCapacity += c_NodeListResizeBy;
         mNodeList = (IDispatch **) realloc(mNodeList, sizeof(IDispatch *) * mNodeListCapacity);
     }
 
     if (mNodeList == NULL)
     {
-        NS_ASSERTION(0, "Could not realloc node list");
+        NS_ERROR("Could not realloc node list");
         return E_OUTOFMEMORY;
     }
 
     pNode->AddRef();
     mNodeList[mNodeListCount++] = pNode;
 
     return S_OK;
 }
@@ -337,17 +337,17 @@ HRESULT STDMETHODCALLTYPE CIEHtmlElement
         for (PRUint32 i = 0; i < length; i++)
         {
             // Get the next item from the list
             nsCOMPtr<nsIDOMNode> childNode;
             mDOMNodeList->Item(i, getter_AddRefs(childNode));
             if (!childNode)
             {
                 // Empty node (unexpected, but try and carry on anyway)
-                NS_ASSERTION(0, "Empty node");
+                NS_ERROR("Empty node");
                 continue;
             }
 
             // Only count elements
             PRUint16 nodeType;
             childNode->GetNodeType(&nodeType);
             if (nodeType == nsIDOMNode::ELEMENT_NODE)
             {
@@ -376,46 +376,46 @@ HRESULT STDMETHODCALLTYPE CIEHtmlElement
 
     *p = NULL;
 
     // Create a new IEnumVARIANT object
     CComEnumVARIANT *pEnumVARIANT = NULL;
     CComEnumVARIANT::CreateInstance(&pEnumVARIANT);
     if (pEnumVARIANT == NULL)
     {
-        NS_ASSERTION(0, "Could not creat Enum");
+        NS_ERROR("Could not creat Enum");
         return E_OUTOFMEMORY;
     }
 
     int nObject = 0;
     long nObjects = 0;
     get_length(&nObjects);
 
     // Create an array of VARIANTs
     VARIANT *avObjects = new VARIANT[nObjects];
     if (avObjects == NULL)
     {
-        NS_ASSERTION(0, "Could not create variant array");
+        NS_ERROR("Could not create variant array");
         return E_OUTOFMEMORY;
     }
 
     if (mDOMNodeList)
     {
         // Fill the variant array with elements from the DOM node list
         PRUint32 length = 0;
         mDOMNodeList->GetLength(&length);
         for (PRUint32 i = 0; i < length; i++)
         {
             // Get the next item from the list
             nsCOMPtr<nsIDOMNode> childNode;
             mDOMNodeList->Item(i, getter_AddRefs(childNode));
             if (!childNode)
             {
                 // Empty node (unexpected, but try and carry on anyway)
-                NS_ASSERTION(0, "Could not get node");
+                NS_ERROR("Could not get node");
                 continue;
             }
 
             // Skip nodes representing, text, attributes etc.
             PRUint16 nodeType;
             childNode->GetNodeType(&nodeType);
             if (nodeType != nsIDOMNode::ELEMENT_NODE)
             {
@@ -523,17 +523,17 @@ HRESULT STDMETHODCALLTYPE CIEHtmlElement
         for (PRUint32 i = 0; i < length; i++)
         {
             // Get the next item from the list
             nsCOMPtr<nsIDOMNode> childNode;
             mDOMNodeList->Item(i, getter_AddRefs(childNode));
             if (!childNode)
             {
                 // Empty node (unexpected, but try and carry on anyway)
-                NS_ASSERTION(0, "Could not get node");
+                NS_ERROR("Could not get node");
                 continue;
             }
 
             // Skip nodes representing, text, attributes etc.
             nsCOMPtr<nsIDOMElement> nodeAsElement = do_QueryInterface(childNode);
             if (!nodeAsElement)
             {
                 continue;
@@ -633,17 +633,17 @@ HRESULT STDMETHODCALLTYPE CIEHtmlElement
             {
                 return E_INVALIDARG;
             }
 
             *pdisp = NULL;
             IDispatch *pNode = mNodeList[idxForSearch];
             if (pNode == NULL)
             {
-                NS_ASSERTION(0, "No node");
+                NS_ERROR("No node");
                 return E_UNEXPECTED;
             }
             pNode->QueryInterface(IID_IDispatch, (void **) pdisp);
         }
     }
 
     // Note: As per docs S_OK is fine even if no node is returned
     return S_OK;
@@ -683,17 +683,17 @@ HRESULT STDMETHODCALLTYPE CIEHtmlElement
         for (PRUint32 i = 0; i < length; i++)
         {
             // Get the next item from the list
             nsCOMPtr<nsIDOMNode> childNode;
             mDOMNodeList->Item(i, getter_AddRefs(childNode));
             if (!childNode)
             {
                 // Empty node (unexpected, but try and carry on anyway)
-                NS_ASSERTION(0, "Could not get node");
+                NS_ERROR("Could not get node");
                 continue;
             }
 
             // Skip nodes representing, text, attributes etc.
             nsCOMPtr<nsIDOMElement> nodeAsElement = do_QueryInterface(childNode);
             if (!nodeAsElement)
             {
                 continue;
--- a/embedding/browser/activex/src/common/IEHtmlNode.cpp
+++ b/embedding/browser/activex/src/common/IEHtmlNode.cpp
@@ -143,17 +143,17 @@ CIEHtmlDomNode::~CIEHtmlDomNode()
 #define CREATE_FROM_DOMNODE(nsInterface, WrapperType, errorMsg) \
     nsCOMPtr<nsInterface> domNode_##nsInterface = do_QueryInterface(pIDOMNode); \
     if (domNode_##nsInterface) \
     { \
         WrapperType *pWrapper = NULL; \
         WrapperType::CreateInstance(&pWrapper); \
         if (!pWrapper) \
         { \
-            NS_ASSERTION(0, errorMsg); \
+            NS_ERROR(errorMsg); \
             return E_OUTOFMEMORY; \
         } \
         if (FAILED(pWrapper->QueryInterface(IID_IUnknown, (void**)pNode))) \
             return E_UNEXPECTED; \
         pWrapper->SetDOMNode(pIDOMNode); \
         return S_OK; \
     }
 
--- a/embedding/browser/activex/src/common/IWebBrowserImpl.h
+++ b/embedding/browser/activex/src/common/IWebBrowserImpl.h
@@ -59,26 +59,26 @@ typedef long SHANDLE_PTR;
 #include "PropertyList.h"
 
 // CPMozillaControl.h was autogenerated by the ATL proxy wizard so don't edit it!
 #include "CPMozillaControl.h"
 
 #define ENSURE_BROWSER_IS_VALID() \
     if (!BrowserIsValid()) \
     { \
-        NS_ASSERTION(0, "Browser is not valid"); \
+        NS_ERROR("Browser is not valid"); \
         return SetErrorInfo(E_UNEXPECTED, L"Browser is not in a valid state"); \
     }
 
 #define ENSURE_GET_WEBNAV() \
     nsCOMPtr<nsIWebNavigation> webNav; \
     nsresult rv = GetWebNavigation(getter_AddRefs(webNav)); \
     if (NS_FAILED(rv)) \
     { \
-        NS_ASSERTION(0, "Cannot get nsIWebNavigation"); \
+        NS_ERROR("Cannot get nsIWebNavigation"); \
         return SetErrorInfo(E_UNEXPECTED, L"Could not obtain nsIWebNavigation interface"); \
     }
 
 template<class T, const CLSID *pclsid, const GUID* plibid = &LIBID_MSHTML>
 class IWebBrowserImpl :
     public CStockPropImpl<T, IWebBrowser2, &IID_IWebBrowser2, plibid>,
     public CProxyDWebBrowserEvents<T>,
     public CProxyDWebBrowserEvents2<T>
@@ -231,34 +231,34 @@ public:
         ATLTRACE(_T("IWebBrowserImpl::Navigate()\n"));
         ENSURE_BROWSER_IS_VALID();
 
         nsresult rv;
 
         // Extract the URL parameter
         if (URL == NULL)
         {
-            NS_ASSERTION(0, "No URL supplied");
+            NS_ERROR("No URL supplied");
             return SetErrorInfo(E_INVALIDARG);
         }
 
         PRBool openInNewWindow = PR_FALSE;
         PRUint32 loadFlags = nsIWebNavigation::LOAD_FLAGS_NONE;
 
         // Extract the navigate flags parameter
         LONG lFlags = 0;
         if (Flags &&
             Flags->vt != VT_ERROR &&
             Flags->vt != VT_EMPTY &&
             Flags->vt != VT_NULL)
         {
             CComVariant vFlags;
             if ( vFlags.ChangeType(VT_I4, Flags) != S_OK )
             {
-                NS_ASSERTION(0, "Flags param is invalid");
+                NS_ERROR("Flags param is invalid");
                 return SetErrorInfo(E_INVALIDARG);
             }
             lFlags = vFlags.lVal;
         }
         if (lFlags & navOpenInNewWindow) 
         {
             openInNewWindow = PR_TRUE;
         }
@@ -375,17 +375,17 @@ public:
                     SafeArrayUnlock(PostData->parray);
 
                     // Create a byte array input stream object.
                     nsCOMPtr<nsIStringInputStream> stream
                         (do_CreateInstance("@mozilla.org/io/string-input-stream;1"));
                     rv = stream->AdoptData(tmp, nSize);
                     if (NS_FAILED(rv) || !stream)
                     {
-                        NS_ASSERTION(0, "cannot create byte stream");
+                        NS_ERROR("cannot create byte stream");
                         nsMemory::Free(tmp);
                         return SetErrorInfo(E_UNEXPECTED);
                     }
 
                     postDataStream = stream;
                 }
             }
         }
@@ -411,17 +411,17 @@ public:
 
                     // Create a byte array input stream object which will own the buffer
                     headersStream = do_CreateInstance("@mozilla.org/io/string-input-stream;1");
                     if (headersStream)
                         rv = headersStream->AdoptData(tmp, nSize);
 
                     if (NS_FAILED(rv) || !headersStream)
                     {
-                        NS_ASSERTION(0, "cannot create byte stream");
+                        NS_ERROR("cannot create byte stream");
                         nsMemory::Free(tmp);
                     }
                 }
             }
         }
 
         // Use the specified target or the top level web navigation
         nsCOMPtr<nsIWebNavigation> webNavToUse;
@@ -462,17 +462,17 @@ public:
         if (Level == NULL)
             return E_INVALIDARG;
 
         // Check the requested refresh type
         OLECMDID_REFRESHFLAG iRefreshLevel = OLECMDIDF_REFRESH_NORMAL;
         CComVariant vLevelAsInt;
         if ( vLevelAsInt.ChangeType(VT_I4, Level) != S_OK )
         {
-            NS_ASSERTION(0, "Cannot change refresh type to int");
+            NS_ERROR("Cannot change refresh type to int");
             return SetErrorInfo(E_UNEXPECTED);
         }
         iRefreshLevel = (OLECMDID_REFRESHFLAG) vLevelAsInt.iVal;
 
         // Turn the IE refresh type into the nearest NG equivalent
         PRUint32 flags = nsIWebNavigation::LOAD_FLAGS_NONE;
         switch (iRefreshLevel & OLECMDIDF_REFRESH_LEVELMASK)
         {
@@ -483,17 +483,17 @@ public:
         case OLECMDIDF_REFRESH_RELOAD:
             flags = nsIWebNavigation::LOAD_FLAGS_NONE;
             break;
         case OLECMDIDF_REFRESH_COMPLETELY:
             flags = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY;
             break;
         default:
             // No idea what refresh type this is supposed to be
-            NS_ASSERTION(0, "Unknown refresh type");
+            NS_ERROR("Unknown refresh type");
             return SetErrorInfo(E_UNEXPECTED);
         }
 
         webNav->Reload(flags);
 
         return S_OK;
     }
     virtual HRESULT STDMETHODCALLTYPE Stop(void)
--- a/embedding/components/commandhandler/src/nsCommandParams.h
+++ b/embedding/components/commandhandler/src/nsCommandParams.h
@@ -105,17 +105,17 @@ protected:
         case eStringType:
           NS_ASSERTION(inRHS.mData.mCString, "Source entry has no string");
           mData.mCString = new nsCString(*inRHS.mData.mCString);
           break;      
         case eISupportsType:
           mISupports = inRHS.mISupports.get();    // additional addref
           break;
         default:
-          NS_ASSERTION(0, "Unknown type");
+          NS_ERROR("Unknown type");
       }
     }
     
     ~HashEntry()
     {
       if (mEntryType == eWStringType)
         delete mData.mString;
       else if (mEntryType == eStringType)
@@ -129,17 +129,17 @@ protected:
         case eNoType:                                       break;
         case eBooleanType:      mData.mBoolean = PR_FALSE;  break;
         case eLongType:         mData.mLong = 0;            break;
         case eDoubleType:       mData.mDouble = 0.0;        break;
         case eWStringType:      delete mData.mString; mData.mString = nsnull;     break;
         case eISupportsType:    mISupports = nsnull;        break;    // clear the nsCOMPtr
         case eStringType:       delete mData.mCString; mData.mCString = nsnull;   break;
         default:
-          NS_ASSERTION(0, "Unknown type");
+          NS_ERROR("Unknown type");
       }
       
       mEntryType = inNewType;
     }
     
   };
 
 
--- a/gfx/src/thebes/nsThebesDeviceContext.cpp
+++ b/gfx/src/thebes/nsThebesDeviceContext.cpp
@@ -1251,17 +1251,17 @@ nsThebesDeviceContext::CalcPrintingSize(
         if (DevQueryCaps(dc, CAPS_COLOR_BITCOUNT, 1, &value))
             mDepth = value;
         else
             mDepth = 8; // default to 8bpp, should be enough for printers
         break;
     }
 #endif
     default:
-        NS_ASSERTION(0, "trying to print to unknown surface type");
+        NS_ERROR("trying to print to unknown surface type");
     }
 
     if (inPoints) {
         mWidth = NSToCoordRound(float(size.width) * AppUnitsPerInch() / 72);
         mHeight = NSToCoordRound(float(size.height) * AppUnitsPerInch() / 72);
     } else {
         mWidth = NSToIntRound(size.width);
         mHeight = NSToIntRound(size.height);
@@ -1310,16 +1310,16 @@ nsThebesDeviceContext::GetPrintHDC()
 #endif
 
 #ifdef XP_OS2
             case gfxASurface::SurfaceTypeOS2:
                 return GpiQueryDevice(reinterpret_cast<gfxOS2Surface*>(mPrintingSurface.get())->GetPS());
 #endif
 
             default:
-                NS_ASSERTION(0, "invalid surface type in GetPrintHDC");
+                NS_ERROR("invalid surface type in GetPrintHDC");
                 break;
         }
     }
 
     return nsnull;
 }
 #endif
--- a/gfx/thebes/src/gfxFT2Fonts.cpp
+++ b/gfx/thebes/src/gfxFT2Fonts.cpp
@@ -703,17 +703,17 @@ gfxFT2Font::GetMetrics()
     gid = FT_Get_Char_Index(face, ' ');
     if (gid) {
         FT_Load_Glyph(face, gid, FT_LOAD_DEFAULT);
         // face->glyph->metrics.width doesn't work for spaces, use advance.x instead
         mMetrics.spaceWidth = face->glyph->advance.x >> 6;
         // save the space glyph
         mSpaceGlyph = gid;
     } else {
-        NS_ASSERTION(0, "blah");
+        NS_ERROR("blah");
     }
             
     // properties of 'x', also use its width as average width
     gid = FT_Get_Char_Index(face, 'x'); // select the glyph
     if (gid) {
         // Load glyph into glyph slot. Here, use no_scale to get font units.
         FT_Load_Glyph(face, gid, FT_LOAD_NO_SCALE);
         mMetrics.xHeight = face->glyph->metrics.height * yScale;
--- a/intl/locale/src/os2/nsCollationOS2.cpp
+++ b/intl/locale/src/os2/nsCollationOS2.cpp
@@ -78,17 +78,17 @@ nsCollationOS2::~nsCollationOS2()
 nsresult nsCollationOS2::Initialize(nsILocale *locale)
 {
   NS_ASSERTION(mCollation == NULL, "Should only be initialized once");
 
   nsresult res;
 
   mCollation = new nsCollation;
   if (mCollation == NULL) {
-    NS_ASSERTION(0, "mCollation creation failed");
+    NS_ERROR("mCollation creation failed");
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   return NS_OK;
 }
 
 
 nsresult nsCollationOS2::CompareString(PRInt32 strength, 
--- a/intl/locale/src/unix/nsCollationUnix.cpp
+++ b/intl/locale/src/unix/nsCollationUnix.cpp
@@ -86,17 +86,17 @@ nsresult nsCollationUnix::Initialize(nsI
 {
 #define kPlatformLocaleLength 64
   NS_ASSERTION(mCollation == NULL, "Should only be initialized once");
 
   nsresult res;
 
   mCollation = new nsCollation;
   if (mCollation == NULL) {
-    NS_ASSERTION(0, "mCollation creation failed");
+    NS_ERROR("mCollation creation failed");
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   // default platform locale
   mLocale.Assign('C');
 
   nsAutoString localeStr;
   NS_NAMED_LITERAL_STRING(aCategory, "NSILOCALE_COLLATE##PLATFORM");
--- a/intl/strres/src/nsStringBundleTextOverride.cpp
+++ b/intl/strres/src/nsStringBundleTextOverride.cpp
@@ -91,17 +91,17 @@ URLPropertyElement::GetValue(nsAString& 
 // setters are kind of strange, hopefully we'll never be called
 NS_IMETHODIMP
 URLPropertyElement::SetKey(const nsACString& aKey)
 {
     // this is just wrong - ideally you'd take the key, append it to
     // the url, and set that as the key. However, that would require
     // us to hold onto a copy of the string, and that's a waste,
     // considering nobody should ever be calling this.
-    NS_ASSERTION(0, "This makes no sense!");
+    NS_ERROR("This makes no sense!");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 URLPropertyElement::SetValue(const nsAString& aValue)
 {
     return mRealElement->SetValue(aValue);
 }
--- a/intl/uconv/src/nsUNIXCharset.cpp
+++ b/intl/uconv/src/nsUNIXCharset.cpp
@@ -121,17 +121,17 @@ nsPlatformCharset::ConvertLocaleToCharse
     localeKey.AssignLiteral("locale.all.");
     localeKey.Append(locale);
     res = gInfo_deprecated->Get(localeKey, charset);
     if (NS_SUCCEEDED(res))  {
       LossyCopyUTF16toASCII(charset, oResult);
       return NS_OK;
     }
    }
-   NS_ASSERTION(0, "unable to convert locale to charset using deprecated config");
+   NS_ERROR("unable to convert locale to charset using deprecated config");
    mCharset.AssignLiteral("ISO-8859-1");
    oResult.AssignLiteral("ISO-8859-1");
    return NS_SUCCESS_USING_FALLBACK_LOCALE;
 }
 
 nsPlatformCharset::~nsPlatformCharset()
 {
   PR_AtomicDecrement(&gCnt);
@@ -200,17 +200,17 @@ nsPlatformCharset::GetDefaultCharsetForL
   // convert from locale to charset
   // using the deprecated locale to charset mapping 
   //
   nsAutoString localeStr(localeName);
   nsresult res = ConvertLocaleToCharsetUsingDeprecatedConfig(localeStr, oResult);
   if (NS_SUCCEEDED(res))
     return res;
 
-  NS_ASSERTION(0, "unable to convert locale to charset using deprecated config");
+  NS_ERROR("unable to convert locale to charset using deprecated config");
   oResult.AssignLiteral("ISO-8859-1");
   return NS_SUCCESS_USING_FALLBACK_LOCALE;
 }
 
 nsresult
 nsPlatformCharset::InitGetCharset(nsACString &oString)
 {
   char* nl_langinfo_codeset = nsnull;
@@ -297,17 +297,17 @@ nsPlatformCharset::InitGetCharset(nsACSt
       res = VerifyCharset(aCharset);
       if (NS_SUCCEEDED(res)) {
         oString = aCharset;
         return res;
       }
     }
   }
 
-  NS_ASSERTION(0, "unable to use nl_langinfo(CODESET)");
+  NS_ERROR("unable to use nl_langinfo(CODESET)");
 #endif
 
   //
   // try falling back on a deprecated (locale based) name
   //
   char* locale = setlocale(LC_CTYPE, nsnull);
   nsAutoString localeStr;
   localeStr.AssignWithConversion(locale);
@@ -340,17 +340,17 @@ nsPlatformCharset::Init()
 
   res = InitGetCharset(charset);
   if (NS_SUCCEEDED(res)) {
     mCharset = charset;
     return res; // succeeded
   }
 
   // last resort fallback
-  NS_ASSERTION(0, "unable to convert locale to charset using deprecated config");
+  NS_ERROR("unable to convert locale to charset using deprecated config");
   mCharset.AssignLiteral("ISO-8859-1");
   return NS_SUCCESS_USING_FALLBACK_LOCALE;
 }
 
 nsresult
 nsPlatformCharset::VerifyCharset(nsCString &aCharset)
 {
   nsresult res;
@@ -363,27 +363,27 @@ nsPlatformCharset::VerifyCharset(nsCStri
     return res;
 
   //
   // check if we can get an input converter
   //
   nsCOMPtr <nsIUnicodeEncoder> enc;
   res = charsetConverterManager->GetUnicodeEncoder(aCharset.get(), getter_AddRefs(enc));
   if (NS_FAILED(res)) {
-    NS_ASSERTION(0, "failed to create encoder");
+    NS_ERROR("failed to create encoder");
     return res;
   }
 
   //
   // check if we can get an output converter
   //
   nsCOMPtr <nsIUnicodeDecoder> dec;
   res = charsetConverterManager->GetUnicodeDecoder(aCharset.get(), getter_AddRefs(dec));
   if (NS_FAILED(res)) {
-    NS_ASSERTION(0, "failed to create decoder");
+    NS_ERROR("failed to create decoder");
     return res;
   }
 
   //
   // check if we recognize the charset string
   //
 
   nsCAutoString result;
--- a/intl/uconv/util/nsUCSupport.cpp
+++ b/intl/uconv/util/nsUCSupport.cpp
@@ -162,26 +162,26 @@ NS_IMETHODIMP nsBufferDecoderSupport::Co
     // Detect invalid input character
     if (res == NS_ERROR_ILLEGAL_INPUT && mErrBehavior == kOnError_Signal) {
       break;
     }
 
     if ((res == NS_OK_UDEC_MOREINPUT) && (bcw == 0)) {
         res = NS_ERROR_UNEXPECTED;
 #if defined(DEBUG_yokoyama) || defined(DEBUG_ftang)
-        NS_ASSERTION(0, "This should not happen. Internal buffer may be corrupted.");
+        NS_ERROR("This should not happen. Internal buffer may be corrupted.");
 #endif
         break;
     } else {
       if (bcr < buffLen) {
         // we didn't convert that residual data - unfill the buffer
         src -= mBufferLength - buffLen;
         mBufferLength = buffLen;
 #if defined(DEBUG_yokoyama) || defined(DEBUG_ftang)
-        NS_ASSERTION(0, "This should not happen. Internal buffer may be corrupted.");
+        NS_ERROR("This should not happen. Internal buffer may be corrupted.");
 #endif
       } else {
         // the buffer and some extra data was converted - unget the rest
         src -= mBufferLength - bcr;
         mBufferLength = 0;
         res = NS_OK;
       }
       break;
--- a/js/jsd/jsd_xpc.cpp
+++ b/js/jsd/jsd_xpc.cpp
@@ -432,17 +432,17 @@ jsds_FilterHook (JSDContext *jsdc, JSDTh
                                 nsACString::const_iterator start, end;
                                 url.BeginReading(start);
                                 url.EndReading(end);
                                 if (FindInReadable(currentFilter->urlPattern, start, end))
                                     return !!(flags & jsdIFilter::FLAG_PASS);
                             }
                             break;
                         default:
-                            NS_ASSERTION(0, "Invalid pattern type");
+                            NS_ERROR("Invalid pattern type");
                     }
                 }                
             }
         }
         currentFilter = reinterpret_cast<FilterRecord *>
                                         (PR_NEXT_LINK(&currentFilter->links));
     } while (currentFilter != gFilters);
 
--- a/js/src/xpconnect/src/XPCDispObject.cpp
+++ b/js/src/xpconnect/src/XPCDispObject.cpp
@@ -300,17 +300,17 @@ JSBool XPCDispObject::Invoke(XPCCallCont
             secFlag   = nsIXPCSecurityManager::HOOK_GET_PROPERTY;
             secAction = nsIXPCSecurityManager::ACCESS_GET_PROPERTY;
             break;
         case CALL_SETTER:
             secFlag   = nsIXPCSecurityManager::HOOK_SET_PROPERTY;
             secAction = nsIXPCSecurityManager::ACCESS_SET_PROPERTY;
             break;
         default:
-            NS_ASSERTION(0,"bad value");
+            NS_ERROR("bad value");
             return JS_FALSE;
     }
     jsval name = member->GetName();
 
     nsIXPCSecurityManager* sm = xpcc->GetAppropriateSecurityManager(secFlag);
     XPCWrappedNative* wrapper = ccx.GetWrapper();
     if(sm && NS_FAILED(sm->CanAccess(secAction, &ccx, ccx,
                                      ccx.GetFlattenedJSObject(),
--- a/js/src/xpconnect/src/xpcconvert.cpp
+++ b/js/src/xpconnect/src/xpcconvert.cpp
@@ -476,17 +476,17 @@ XPCConvert::NativeData2JS(XPCLazyCallCon
                     if(jsobj && !STOBJ_GET_PARENT(jsobj))
                         NS_ASSERTION(STOBJ_GET_CLASS(jsobj)->flags & JSCLASS_IS_GLOBAL,
                                      "Why did we recreate this wrapper?");
 #endif
                 }
                 break;
             }
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             return JS_FALSE;
         }
     }
     return JS_TRUE;
 }
 
 /***************************************************************************/
 
@@ -615,25 +615,25 @@ XPCConvert::JSData2Native(XPCCallContext
                 return JS_FALSE;
             }
             *((uint16*)d)  = (uint16) chars[0];
             break;
         }
     default:
         if(!type.IsPointer())
         {
-            NS_ASSERTION(0,"unsupported type");
+            NS_ERROR("unsupported type");
             return JS_FALSE;
         }
 
         switch(type.TagPart())
         {
         case nsXPTType::T_VOID:
             XPC_LOG_ERROR(("XPCConvert::JSData2Native : void* params not supported"));
-            NS_ASSERTION(0,"void* params not supported");
+            NS_ERROR("void* params not supported");
             return JS_FALSE;
         case nsXPTType::T_IID:
         {
             NS_ASSERTION(useAllocator,"trying to convert a JSID to nsID without allocator : this would leak");
 
             JSObject* obj;
             const nsID* pid=nsnull;
 
@@ -1012,17 +1012,17 @@ XPCConvert::JSData2Native(XPCCallContext
                     *pErr = NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL;
                 return JS_FALSE;
             }
 
             return JSObject2NativeInterface(ccx, (void**)d, obj, iid,
                                             nsnull, pErr);
         }
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             return JS_FALSE;
         }
     }
     return JS_TRUE;
 }
 
 inline JSBool
 CreateHolderIfNeeded(XPCCallContext& ccx, JSObject* obj, jsval* d,
@@ -1592,17 +1592,17 @@ XPCConvert::JSValToXPCException(XPCCallC
 
     if(!JSVAL_IS_PRIMITIVE(s))
     {
         // we have a JSObject
         JSObject* obj = JSVAL_TO_OBJECT(s);
 
         if(!obj)
         {
-            NS_ASSERTION(0, "when is an object not an object?");
+            NS_ERROR("when is an object not an object?");
             return NS_ERROR_FAILURE;
         }
 
         // is this really a native xpcom object with a wrapper?
         XPCWrappedNative* wrapper;
         if(nsnull != (wrapper =
            XPCWrappedNative::GetWrappedNativeOfJSObject(cx,obj)))
         {
@@ -1986,27 +1986,27 @@ XPCConvert::NativeArray2JS(XPCLazyCallCo
     case nsXPTType::T_U16           : POPULATE(uint16);         break;
     case nsXPTType::T_U32           : POPULATE(uint32);         break;
     case nsXPTType::T_U64           : POPULATE(uint64);         break;
     case nsXPTType::T_FLOAT         : POPULATE(float);          break;
     case nsXPTType::T_DOUBLE        : POPULATE(double);         break;
     case nsXPTType::T_BOOL          : POPULATE(PRBool);         break;
     case nsXPTType::T_CHAR          : POPULATE(char);           break;
     case nsXPTType::T_WCHAR         : POPULATE(jschar);         break;
-    case nsXPTType::T_VOID          : NS_ASSERTION(0,"bad type"); goto failure;
+    case nsXPTType::T_VOID          : NS_ERROR("bad type"); goto failure;
     case nsXPTType::T_IID           : POPULATE(nsID*);          break;
-    case nsXPTType::T_DOMSTRING     : NS_ASSERTION(0,"bad type"); goto failure;
+    case nsXPTType::T_DOMSTRING     : NS_ERROR("bad type"); goto failure;
     case nsXPTType::T_CHAR_STR      : POPULATE(char*);          break;
     case nsXPTType::T_WCHAR_STR     : POPULATE(jschar*);        break;
     case nsXPTType::T_INTERFACE     : POPULATE(nsISupports*);   break;
     case nsXPTType::T_INTERFACE_IS  : POPULATE(nsISupports*);   break;
-    case nsXPTType::T_UTF8STRING    : NS_ASSERTION(0,"bad type"); goto failure;
-    case nsXPTType::T_CSTRING       : NS_ASSERTION(0,"bad type"); goto failure;
-    case nsXPTType::T_ASTRING       : NS_ASSERTION(0,"bad type"); goto failure;
-    default                         : NS_ASSERTION(0,"bad type"); goto failure;
+    case nsXPTType::T_UTF8STRING    : NS_ERROR("bad type"); goto failure;
+    case nsXPTType::T_CSTRING       : NS_ERROR("bad type"); goto failure;
+    case nsXPTType::T_ASTRING       : NS_ERROR("bad type"); goto failure;
+    default                         : NS_ERROR("bad type"); goto failure;
     }
 
     if(pErr)
         *pErr = NS_OK;
     return JS_TRUE;
 
 failure:
     return JS_FALSE;
@@ -2119,27 +2119,27 @@ fill_array:
     case nsXPTType::T_U16           : POPULATE(na, uint16);         break;
     case nsXPTType::T_U32           : POPULATE(na, uint32);         break;
     case nsXPTType::T_U64           : POPULATE(na, uint64);         break;
     case nsXPTType::T_FLOAT         : POPULATE(na, float);          break;
     case nsXPTType::T_DOUBLE        : POPULATE(na, double);         break;
     case nsXPTType::T_BOOL          : POPULATE(na, PRBool);         break;
     case nsXPTType::T_CHAR          : POPULATE(na, char);           break;
     case nsXPTType::T_WCHAR         : POPULATE(na, jschar);         break;
-    case nsXPTType::T_VOID          : NS_ASSERTION(0,"bad type"); goto failure;
+    case nsXPTType::T_VOID          : NS_ERROR("bad type"); goto failure;
     case nsXPTType::T_IID           : POPULATE(fr, nsID*);          break;
-    case nsXPTType::T_DOMSTRING     : NS_ASSERTION(0,"bad type"); goto failure;
+    case nsXPTType::T_DOMSTRING     : NS_ERROR("bad type"); goto failure;
     case nsXPTType::T_CHAR_STR      : POPULATE(fr, char*);          break;
     case nsXPTType::T_WCHAR_STR     : POPULATE(fr, jschar*);        break;
     case nsXPTType::T_INTERFACE     : POPULATE(re, nsISupports*);   break;
     case nsXPTType::T_INTERFACE_IS  : POPULATE(re, nsISupports*);   break;
-    case nsXPTType::T_UTF8STRING    : NS_ASSERTION(0,"bad type"); goto failure;
-    case nsXPTType::T_CSTRING       : NS_ASSERTION(0,"bad type"); goto failure;
-    case nsXPTType::T_ASTRING       : NS_ASSERTION(0,"bad type"); goto failure;
-    default                         : NS_ASSERTION(0,"bad type"); goto failure;
+    case nsXPTType::T_UTF8STRING    : NS_ERROR("bad type"); goto failure;
+    case nsXPTType::T_CSTRING       : NS_ERROR("bad type"); goto failure;
+    case nsXPTType::T_ASTRING       : NS_ERROR("bad type"); goto failure;
+    default                         : NS_ERROR("bad type"); goto failure;
     }
 
     *d = array;
     if(pErr)
         *pErr = NS_OK;
     return JS_TRUE;
 
 failure:
--- a/js/src/xpconnect/src/xpcjsid.cpp
+++ b/js/src/xpconnect/src/xpcjsid.cpp
@@ -198,17 +198,17 @@ nsJSID::GetInvalidIID() const
 }
 
 //static
 nsJSID*
 nsJSID::NewID(const char* str)
 {
     if(!str)
     {
-        NS_ASSERTION(0,"no string");
+        NS_ERROR("no string");
         return nsnull;
     }
 
     nsJSID* idObj = new nsJSID();
     if(idObj)
     {
         NS_ADDREF(idObj);
         if(NS_FAILED(idObj->Initialize(str)))
@@ -699,17 +699,17 @@ nsJSCID::ResolveName()
 }
 
 //static
 nsJSCID*
 nsJSCID::NewID(const char* str)
 {
     if(!str)
     {
-        NS_ASSERTION(0,"no string");
+        NS_ERROR("no string");
         return nsnull;
     }
 
     nsJSCID* idObj = new nsJSCID();
     if(idObj)
     {
         PRBool success = PR_FALSE;
         NS_ADDREF(idObj);
--- a/js/src/xpconnect/src/xpcthreadcontext.cpp
+++ b/js/src/xpconnect/src/xpcthreadcontext.cpp
@@ -459,37 +459,37 @@ XPCPerThreadData::GetDataImpl(JSContext 
     {
         nsAutoLock lock(gLock);
         // check again now that we have the lock...
         if(gTLSIndex == BAD_TLS_INDEX)
         {
             if(PR_FAILURE ==
                PR_NewThreadPrivateIndex(&gTLSIndex, xpc_ThreadDataDtorCB))
             {
-                NS_ASSERTION(0, "PR_NewThreadPrivateIndex failed!");
+                NS_ERROR("PR_NewThreadPrivateIndex failed!");
                 gTLSIndex = BAD_TLS_INDEX;
                 return nsnull;
             }
         }
     }
 
     data = (XPCPerThreadData*) PR_GetThreadPrivate(gTLSIndex);
     if(!data)
     {
         data = new XPCPerThreadData();
         if(!data || !data->IsValid())
         {
-            NS_ASSERTION(0, "new XPCPerThreadData() failed!");
+            NS_ERROR("new XPCPerThreadData() failed!");
             if(data)
                 delete data;
             return nsnull;
         }
         if(PR_FAILURE == PR_SetThreadPrivate(gTLSIndex, data))
         {
-            NS_ASSERTION(0, "PR_SetThreadPrivate failed!");
+            NS_ERROR("PR_SetThreadPrivate failed!");
             delete data;
             return nsnull;
         }
     }
 
     if(cx && !sMainJSThread && NS_IsMainThread())
     {
         sMainJSThread = cx->thread;
--- a/js/src/xpconnect/src/xpcwrappednative.cpp
+++ b/js/src/xpconnect/src/xpcwrappednative.cpp
@@ -2284,17 +2284,17 @@ XPCWrappedNative::CallMethod(XPCCallCont
             secFlag   = nsIXPCSecurityManager::HOOK_GET_PROPERTY;
             secAction = nsIXPCSecurityManager::ACCESS_GET_PROPERTY;
             break;
         case CALL_SETTER:
             secFlag   = nsIXPCSecurityManager::HOOK_SET_PROPERTY;
             secAction = nsIXPCSecurityManager::ACCESS_SET_PROPERTY;
             break;
         default:
-            NS_ASSERTION(0,"bad value");
+            NS_ERROR("bad value");
             return JS_FALSE;
     }
 
     sm = xpcc->GetAppropriateSecurityManager(secFlag);
     if(sm && NS_FAILED(sm->CanAccess(secAction, &ccx, ccx,
                                      ccx.GetFlattenedJSObject(),
                                      ccx.GetWrapper()->GetIdentityObject(),
                                      ccx.GetWrapper()->GetClassInfo(), name,
@@ -2847,17 +2847,17 @@ done:
                     JSUint32 array_count;
 
                     const nsXPTParamInfo& paramInfo = methodInfo->GetParam(i);
                     if(!GetArraySizeFromParam(ccx, ifaceInfo, methodInfo,
                                               paramInfo, vtblIndex,
                                               i, GET_LENGTH, dispatchParams,
                                               &array_count))
                     {
-                        NS_ASSERTION(0,"failed to get array length, we'll leak here");
+                        NS_ERROR("failed to get array length, we'll leak here");
                         continue;
                     }
                     if(dp->IsValAllocated())
                     {
                         void** a = (void**)p;
                         for(JSUint32 k = 0; k < array_count; k++)
                         {
                             void* o = a[k];
@@ -3725,17 +3725,17 @@ XPCJSObjectHolder::PrintTraceName(JSTrac
 #endif
 
 // static
 XPCJSObjectHolder*
 XPCJSObjectHolder::newHolder(XPCCallContext& ccx, JSObject* obj)
 {
     if(!obj)
     {
-        NS_ASSERTION(0, "bad param");
+        NS_ERROR("bad param");
         return nsnull;
     }
     return new XPCJSObjectHolder(ccx, obj);
 }
 
 JSBool
 MorphSlimWrapper(JSContext *cx, JSObject *obj)
 {
--- a/js/src/xpconnect/src/xpcwrappednativeinfo.cpp
+++ b/js/src/xpconnect/src/xpcwrappednativeinfo.cpp
@@ -431,17 +431,17 @@ XPCNativeInterface::NewInstance(XPCCallC
             continue;
 
         if(!XPCConvert::IsMethodReflectable(*info))
             continue;
 
         str = JS_InternString(ccx, info->GetName());
         if(!str)
         {
-            NS_ASSERTION(0,"bad method name");
+            NS_ERROR("bad method name");
             failed = JS_TRUE;
             break;
         }
         name = STRING_TO_JSVAL(str);
 
         if(info->IsSetter())
         {
             NS_ASSERTION(realTotalCount,"bad setter");
@@ -475,17 +475,17 @@ XPCNativeInterface::NewInstance(XPCCallC
             {
                 failed = JS_TRUE;
                 break;
             }
 
             str = JS_InternString(ccx, constant->GetName());
             if(!str)
             {
-                NS_ASSERTION(0,"bad constant name");
+                NS_ERROR("bad constant name");
                 failed = JS_TRUE;
                 break;
             }
             name = STRING_TO_JSVAL(str);
 
             // XXX need better way to find dups
             //NS_ASSERTION(!LookupMemberByID(name),"duplicate method/constant name");
 
--- a/js/src/xpconnect/tests/TestXPC.cpp
+++ b/js/src/xpconnect/tests/TestXPC.cpp
@@ -234,17 +234,17 @@ MySecMan::CanCreateWrapper(JSContext * a
         case OK_ALL:
             return NS_OK;
         case VETO_ALL:
             JS_SetPendingException(aJSContext,
                 STRING_TO_JSVAL(JS_NewStringCopyZ(aJSContext,
                     "security exception")));
             return NS_ERROR_FAILURE;
         default:
-            NS_ASSERTION(0,"bad case");
+            NS_ERROR("bad case");
             return NS_OK;
     }
 }
 
 NS_IMETHODIMP
 MySecMan::CanCreateInstance(JSContext * aJSContext, const nsCID & aCID)
 {
     switch(mMode)
@@ -252,17 +252,17 @@ MySecMan::CanCreateInstance(JSContext * 
         case OK_ALL:
             return NS_OK;
         case VETO_ALL:
             JS_SetPendingException(aJSContext,
                 STRING_TO_JSVAL(JS_NewStringCopyZ(aJSContext,
                     "security exception")));
             return NS_ERROR_FAILURE;
         default:
-            NS_ASSERTION(0,"bad case");
+            NS_ERROR("bad case");
             return NS_OK;
     }
 }
 
 NS_IMETHODIMP
 MySecMan::CanGetService(JSContext * aJSContext, const nsCID & aCID)
 {
     switch(mMode)
@@ -270,17 +270,17 @@ MySecMan::CanGetService(JSContext * aJSC
         case OK_ALL:
             return NS_OK;
         case VETO_ALL:
             JS_SetPendingException(aJSContext,
                 STRING_TO_JSVAL(JS_NewStringCopyZ(aJSContext,
                     "security exception")));
             return NS_ERROR_FAILURE;
         default:
-            NS_ASSERTION(0,"bad case");
+            NS_ERROR("bad case");
             return NS_OK;
     }
 }
 
 /* void CanAccess (in PRUint32 aAction, in nsIXPCNativeCallContext aCallContext, in JSContextPtr aJSContext, in JSObjectPtr aJSObject, in nsISupports aObj, in nsIClassInfo aClassInfo, in JSVal aName, inout voidPtr aPolicy); */
 NS_IMETHODIMP 
 MySecMan::CanAccess(PRUint32 aAction, nsAXPCNativeCallContext *aCallContext, JSContext * aJSContext, JSObject * aJSObject, nsISupports *aObj, nsIClassInfo *aClassInfo, jsval aName, void * *aPolicy)
 {
@@ -289,17 +289,17 @@ MySecMan::CanAccess(PRUint32 aAction, ns
         case OK_ALL:
             return NS_OK;
         case VETO_ALL:
             JS_SetPendingException(aJSContext,
                 STRING_TO_JSVAL(JS_NewStringCopyZ(aJSContext,
                     "security exception")));
             return NS_ERROR_FAILURE;
         default:
-            NS_ASSERTION(0,"bad case");
+            NS_ERROR("bad case");
             return NS_OK;
     }
 }
 
 /**********************************************/
 static void
 EvaluateScript(JSContext* jscontext, JSObject* glob, MySecMan* sm, MySecMan::Mode mode, const char* msg, const char* t, jsval &rval)
 {
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -11252,17 +11252,17 @@ nsCSSFrameConstructor::ReframeContaining
 
   // XXXbz how exactly would we get here while isReflowing anyway?  Should this
   // whole test be ifdef DEBUG?
   PRBool isReflowing;
   mPresShell->IsReflowLocked(&isReflowing);
   if(isReflowing) {
     // don't ReframeContainingBlock, this will result in a crash
     // if we remove a tree that's in reflow - see bug 121368 for testcase
-    NS_ASSERTION(0, "Atemptted to nsCSSFrameConstructor::ReframeContainingBlock during a Reflow!!!");
+    NS_ERROR("Atemptted to nsCSSFrameConstructor::ReframeContainingBlock during a Reflow!!!");
     return NS_OK;
   }
 
   // Get the first "normal" ancestor of the target frame.
   nsIFrame* containingBlock = GetIBContainingBlockFor(aFrame);
   if (containingBlock) {
     // From here we look for the containing block in case the target
     // frame is already a block (which can happen when an inline frame
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -2281,17 +2281,17 @@ nsTextControlFrame::OffsetToDOMPoint(PRI
         NS_ADDREF(*aResult);
         return NS_OK;
       }
 
       ++textOffset;
     }
   }
 
-  NS_ASSERTION(0, "We should never get here!");
+  NS_ERROR("We should never get here!");
 
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsTextControlFrame::GetSelectionRange(PRInt32* aSelectionStart, PRInt32* aSelectionEnd)
 {
   // make sure we have an editor
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -5400,17 +5400,17 @@ nsIFrame::GetFrameFromDirection(nsDirect
       if (aDirection == eDirPrevious) {
         nsFrame::GetFirstLeaf(presContext, &firstFrame);
         atLineEdge = firstFrame == traversedFrame;
       } else { // eDirNext
         lastFrame = firstFrame;
         for (;lineFrameCount > 1;lineFrameCount --){
           result = it->GetNextSiblingOnLine(lastFrame, thisLine);
           if (NS_FAILED(result) || !lastFrame){
-            NS_ASSERTION(0,"should not be reached nsFrame\n");
+            NS_ERROR("should not be reached nsFrame\n");
             return NS_ERROR_FAILURE;
           }
         }
         nsFrame::GetLastLeaf(presContext, &lastFrame);
         atLineEdge = lastFrame == traversedFrame;
       }
     }
 
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -844,17 +844,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END
 
 
 nsresult
 nsFrameSelection::FetchDesiredX(nscoord &aDesiredX) //the x position requested by the Key Handling for up down
 {
   if (!mShell)
   {
-    NS_ASSERTION(0,"fetch desired X failed\n");
+    NS_ERROR("fetch desired X failed\n");
     return NS_ERROR_FAILURE;
   }
   if (mDesiredXSet)
   {
     aDesiredX = mDesiredX;
     return NS_OK;
   }
 
--- a/layout/mathml/nsMathMLmpaddedFrame.cpp
+++ b/layout/mathml/nsMathMLmpaddedFrame.cpp
@@ -321,17 +321,17 @@ nsMathMLmpaddedFrame::UpdateValue(PRInt3
 
         case NS_MATHML_PSEUDO_UNIT_LSPACE:
              scaler = aLeftSpace;
              break;
 
         default:
           // if we ever reach here, it would mean something is wrong 
           // somewhere with the setup and/or the caller
-          NS_ASSERTION(0, "Unexpected Pseudo Unit");
+          NS_ERROR("Unexpected Pseudo Unit");
           return;
       }
     }
 
     if (eCSSUnit_Number == unit)
       amount = NSToCoordRound(float(scaler) * aCSSValue.GetFloatValue());
     else if (eCSSUnit_Percent == unit)
       amount = NSToCoordRound(float(scaler) * aCSSValue.GetPercentValue());
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -702,17 +702,17 @@ MakeNewNPAPIStreamInternal(NPP npp, cons
   case eNPPStreamTypeInternal_Post:
     {
       if (NS_FAILED(pluginHost->PostURL(inst, relativeURL, len, buf, file, target,
                                 listener)))
         return NPERR_GENERIC_ERROR;
       break;
     }
   default:
-    NS_ASSERTION(0, "how'd I get here");
+    NS_ERROR("how'd I get here");
   }
 
   return NPERR_NO_ERROR;
 }
 
 //
 // Static callbacks that get routed back through the new C++ API
 //
--- a/security/manager/ssl/src/nsCipherInfo.cpp
+++ b/security/manager/ssl/src/nsCipherInfo.cpp
@@ -81,17 +81,17 @@ nsCipherInfo::nsCipherInfo(PRUint16 aCip
   
     PRBool isGood = (
       (SECSuccess == SSL_GetCipherSuiteInfo(i_id, &mInfo, sizeof(mInfo)))
       &&
       (sizeof(mInfo) == mInfo.length));
 
     if (!isGood)
     {
-      NS_ASSERTION(0, "unable to get info for implemented cipher");
+      NS_ERROR("unable to get info for implemented cipher");
       continue;
     }
     
     mHaveInfo = PR_TRUE;
   }
 }
 
 nsCipherInfo::~nsCipherInfo()
--- a/security/manager/ssl/src/nsCrypto.cpp
+++ b/security/manager/ssl/src/nsCrypto.cpp
@@ -2103,17 +2103,17 @@ nsP12Runnable::Run()
   nssComponent->GetPIPNSSBundleString("ForcedBackup3", temp);
 
   final.Append(temp.get());
   alertUser(final.get());
 
   nsCOMPtr<nsIFilePicker> filePicker = 
                         do_CreateInstance("@mozilla.org/filepicker;1", &rv);
   if (!filePicker) {
-    NS_ASSERTION(0, "Could not create a file picker when backing up certs.");
+    NS_ERROR("Could not create a file picker when backing up certs.");
     return rv;
   }
 
   nsCOMPtr<nsIWindowWatcher> wwatch =
     (do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIDOMWindow> window;
@@ -3009,12 +3009,12 @@ nsPkcs11::AddModule(const nsAString& aMo
   switch (srv) {
   case SECSuccess:
     return NS_OK;
   case SECFailure:
     return NS_ERROR_FAILURE;
   case -2:
     return NS_ERROR_ILLEGAL_VALUE;
   }
-  NS_ASSERTION(0,"Bogus return value, this should never happen");
+  NS_ERROR("Bogus return value, this should never happen");
   return NS_ERROR_FAILURE;
 }
 
--- a/security/manager/ssl/src/nsNSSASN1Object.cpp
+++ b/security/manager/ssl/src/nsNSSASN1Object.cpp
@@ -179,17 +179,17 @@ buildASN1ObjectFromDER(unsigned char *da
           break;
         case SEC_ASN1_CONTEXT_SPECIFIC:
           type = nsIASN1Object::ASN1_CONTEXT_SPECIFIC;
           break;
         case SEC_ASN1_PRIVATE:
           type = nsIASN1Object::ASN1_PRIVATE;
           break;
         default:
-          NS_ASSERTION(0,"Bad DER");
+          NS_ERROR("Bad DER");
           return NS_ERROR_FAILURE;
         }
         sequence->SetTag(tagnum);
         sequence->SetType(type);
         rv = buildASN1ObjectFromDER(data, (len == 0) ? end : data + len, 
                                     sequence);
         asn1Obj = sequence;
       }
--- a/security/manager/ssl/src/nsNSSCertHelper.cpp
+++ b/security/manager/ssl/src/nsNSSCertHelper.cpp
@@ -104,17 +104,17 @@ static const unsigned int numOids = (siz
 static nsresult
 GetIntValue(SECItem *versionItem, 
             unsigned long *version)
 {
   SECStatus srv;
 
   srv = SEC_ASN1DecodeInteger(versionItem,version);
   if (srv != SECSuccess) {
-    NS_ASSERTION(0,"Could not decode version of cert");
+    NS_ERROR("Could not decode version of cert");
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
 static nsresult
 ProcessVersion(SECItem         *versionItem,
                nsINSSComponent *nssComponent,
@@ -150,17 +150,17 @@ ProcessVersion(SECItem         *versionI
     break;
   case 1:
     rv = nssComponent->GetPIPNSSBundleString("CertDumpVersion2", text);
     break;
   case 2:
     rv = nssComponent->GetPIPNSSBundleString("CertDumpVersion3", text);
     break;
   default:
-    NS_ASSERTION(0,"Bad value for cert version");
+    NS_ERROR("Bad value for cert version");
     rv = NS_ERROR_FAILURE;
   }
     
   if (NS_FAILED(rv))
     return rv;
 
   rv = printableItem->SetDisplayValue(text);
   if (NS_FAILED(rv))
--- a/security/manager/ssl/src/nsNSSCertificate.cpp
+++ b/security/manager/ssl/src/nsNSSCertificate.cpp
@@ -591,17 +591,17 @@ nsNSSCertificate::GetWindowTitle(char * 
         } else if (mCert->emailAddr) {
           *aWindowTitle = PL_strdup(mCert->emailAddr);
         } else {
           *aWindowTitle = PL_strdup("");
         }
       }
     }
   } else {
-    NS_ASSERTION(0,"Somehow got nsnull for mCertificate in nsNSSCertificate.");
+    NS_ERROR("Somehow got nsnull for mCertificate in nsNSSCertificate.");
     *aWindowTitle = nsnull;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSCertificate::GetNickname(nsAString &aNickname)
 {
@@ -1636,22 +1636,22 @@ nsNSSCertList::AddCert(nsIX509Cert *aCer
 {
   /* This should be a query interface, but currently this his how the
    * rest of PSM is working */
   nsCOMPtr<nsIX509Cert2> nssCert = do_QueryInterface(aCert);
   CERTCertificate *cert;
 
   cert = nssCert->GetCert();
   if (cert == nsnull) {
-    NS_ASSERTION(0,"Somehow got nsnull for mCertificate in nsNSSCertificate.");
+    NS_ERROR("Somehow got nsnull for mCertificate in nsNSSCertificate.");
     return NS_ERROR_FAILURE;
   }
 
   if (mCertList == nsnull) {
-    NS_ASSERTION(0,"Somehow got nsnull for mCertList in nsNSSCertList.");
+    NS_ERROR("Somehow got nsnull for mCertList in nsNSSCertList.");
     return NS_ERROR_FAILURE;
   }
   CERT_AddCertToListTail(mCertList,cert);
   return NS_OK;
 }
 
 /* void deleteCert (in nsIX509Cert cert); */
 NS_IMETHODIMP
@@ -1659,22 +1659,22 @@ nsNSSCertList::DeleteCert(nsIX509Cert *a
 {
   /* This should be a query interface, but currently this his how the
    * rest of PSM is working */
   nsCOMPtr<nsIX509Cert2> nssCert = do_QueryInterface(aCert);
   CERTCertificate *cert = nssCert->GetCert();
   CERTCertListNode *node;
 
   if (cert == nsnull) {
-    NS_ASSERTION(0,"Somehow got nsnull for mCertificate in nsNSSCertificate.");
+    NS_ERROR("Somehow got nsnull for mCertificate in nsNSSCertificate.");
     return NS_ERROR_FAILURE;
   }
 
   if (mCertList == nsnull) {
-    NS_ASSERTION(0,"Somehow got nsnull for mCertList in nsNSSCertList.");
+    NS_ERROR("Somehow got nsnull for mCertList in nsNSSCertList.");
     return NS_ERROR_FAILURE;
   }
 
   for (node = CERT_LIST_HEAD(mCertList); !CERT_LIST_END(node,mCertList);
                                              node = CERT_LIST_NEXT(node)) {
     if (node->cert == cert) {
 	CERT_RemoveCertListNode(node);
         return NS_OK;
--- a/security/manager/ssl/src/nsNSSCertificateDB.cpp
+++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp
@@ -442,17 +442,17 @@ nsNSSCertificateDB::handleCACertDownload
     CERTCertificate *tmpCert2 = 
       CERT_NewTempCertificate(certdb, &der, nsnull, PR_FALSE, PR_TRUE);
 
     nsMemory::Free(der.data);
     der.data = nsnull;
     der.len = 0;
 
     if (!tmpCert2) {
-      NS_ASSERTION(0, "Couldn't create temp cert from DER blob\n");
+      NS_ERROR("Couldn't create temp cert from DER blob\n");
       continue;  // Let's try to import the rest of 'em
     }
     
     CERT_AddCertToListTail(certList, tmpCert2);
   }
 
   return ImportValidCACertsInList(certList, ctx);
 }
@@ -1689,17 +1689,17 @@ NS_IMETHODIMP nsNSSCertificateDB::AddCer
   if (!tmpCert) 
     tmpCert = CERT_NewTempCertificate(certdb, &der,
                                       nsnull, PR_FALSE, PR_TRUE);
   nsMemory::Free(der.data);
   der.data = nsnull;
   der.len = 0;
 
   if (!tmpCert) {
-    NS_ASSERTION(0,"Couldn't create cert from DER blob\n");
+    NS_ERROR("Couldn't create cert from DER blob\n");
     return NS_ERROR_FAILURE;
   }
 
   if (tmpCert->isperm) {
     CERT_DestroyCertificate(tmpCert);
     return NS_OK;
   }
 
--- a/toolkit/components/downloads/src/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/src/nsDownloadManager.cpp
@@ -791,17 +791,17 @@ nsDownloadManager::InitDB()
       rv = InitMemoryDB();
       break;
 
     case DATABASE_DISK:
       rv = InitFileDB();
       break;
 
     default:
-      NS_ASSERTION(0, "Unexpected value encountered for nsDownloadManager::mDBType");
+      NS_ERROR("Unexpected value encountered for nsDownloadManager::mDBType");
       break;
   }
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING(
     "UPDATE moz_downloads "
     "SET tempPath = ?1, startTime = ?2, endTime = ?3, state = ?4, "
         "referrer = ?5, entityID = ?6, currBytes = ?7, maxBytes = ?8, "
--- a/widget/src/beos/nsWindow.cpp
+++ b/widget/src/beos/nsWindow.cpp
@@ -1405,17 +1405,17 @@ NS_METHOD nsWindow::SetCursor(nsCursor a
 				newCursor = gCursorArray.SafeElementAt(1);
 				break;
 
 			case eCursor_none:
 				be_app->HideCursor();
 				break;
 
 			default:
-				NS_ASSERTION(0, "Invalid cursor type");
+				NS_ERROR("Invalid cursor type");
 				break;
 		}
 		NS_ASSERTION(newCursor != nsnull, "Cursor not stored in array properly!");
 		mCursor = aCursor;
 		be_app->SetCursor(newCursor, true);
 	}
 	return NS_OK;
 }
--- a/widget/src/cocoa/nsChildView.mm
+++ b/widget/src/cocoa/nsChildView.mm
@@ -766,17 +766,17 @@ void* nsChildView::GetNativeData(PRUint3
       retVal = (void*)mView;
       break;
 
     case NS_NATIVE_WINDOW:
       retVal = [mView nativeWindow];
       break;
 
     case NS_NATIVE_GRAPHIC:
-      NS_ASSERTION(0, "Requesting NS_NATIVE_GRAPHIC on a Mac OS X child view!");
+      NS_ERROR("Requesting NS_NATIVE_GRAPHIC on a Mac OS X child view!");
       retVal = nsnull;
       break;
 
     case NS_NATIVE_OFFSETX:
       retVal = 0;
       break;
 
     case NS_NATIVE_OFFSETY:
--- a/widget/src/cocoa/nsCocoaWindow.mm
+++ b/widget/src/cocoa/nsCocoaWindow.mm
@@ -526,17 +526,17 @@ void* nsCocoaWindow::GetNativeData(PRUin
       
     case NS_NATIVE_WINDOW:
       retVal = mWindow;
       break;
       
     case NS_NATIVE_GRAPHIC:
       // There isn't anything that makes sense to return here,
       // and it doesn't matter so just return nsnull.
-      NS_ASSERTION(0, "Requesting NS_NATIVE_GRAPHIC on a top-level window!");
+      NS_ERROR("Requesting NS_NATIVE_GRAPHIC on a top-level window!");
       break;
   }
 
   return retVal;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSNULL;
 }
 
--- a/widget/src/cocoa/nsFilePicker.mm
+++ b/widget/src/cocoa/nsFilePicker.mm
@@ -254,17 +254,17 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16
       userClicksOK = PutLocalFile(mTitle, mDefault, getter_AddRefs(theFile));
       break;
       
     case modeGetFolder:
       userClicksOK = GetLocalFolder(mTitle, getter_AddRefs(theFile));
       break;
     
     default:
-      NS_ASSERTION(0, "Unknown file picker mode");
+      NS_ERROR("Unknown file picker mode");
       break;
   }
 
   if (theFile)
     mFiles.AppendObject(theFile);
   
   *retval = userClicksOK;
   return NS_OK;
--- a/widget/src/cocoa/nsToolkit.mm
+++ b/widget/src/cocoa/nsToolkit.mm
@@ -156,17 +156,17 @@ nsToolkit::RegisterForSleepWakeNotifcati
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   IONotificationPortRef notifyPortRef;
 
   NS_ASSERTION(!mSleepWakeNotificationRLS, "Already registered for sleep/wake");
 
   gRootPort = ::IORegisterForSystemPower(0, &notifyPortRef, ToolkitSleepWakeCallback, &mPowerNotifier);
   if (gRootPort == MACH_PORT_NULL) {
-    NS_ASSERTION(0, "IORegisterForSystemPower failed");
+    NS_ERROR("IORegisterForSystemPower failed");
     return NS_ERROR_FAILURE;
   }
 
   mSleepWakeNotificationRLS = ::IONotificationPortGetRunLoopSource(notifyPortRef);
   ::CFRunLoopAddSource(::CFRunLoopGetCurrent(),
                        mSleepWakeNotificationRLS,
                        kCFRunLoopDefaultMode);
 
--- a/widget/src/os2/nsDragService.cpp
+++ b/widget/src/os2/nsDragService.cpp
@@ -363,23 +363,23 @@ MRESULT EXPENTRY nsDragWindowProc(HWND h
 //-------------------------------------------------------------------------
 
 // if the versions of Start & EndDragSession in nsBaseDragService
 // were called (and they shouldn't be), they'd break nsIDragSessionOS2;
 // they're overridden here and turned into no-ops to prevent this
 
 NS_IMETHODIMP nsDragService::StartDragSession()
 {
-  NS_ASSERTION(0, "OS/2 version of StartDragSession() should never be called!");
+  NS_ERROR("OS/2 version of StartDragSession() should never be called!");
   return NS_OK;
 }
 
 NS_IMETHODIMP nsDragService::EndDragSession(PRBool aDragDone)
 {
-  NS_ASSERTION(0, "OS/2 version of EndDragSession() should never be called!");
+  NS_ERROR("OS/2 version of EndDragSession() should never be called!");
   return NS_OK;
 }
 
 // --------------------------------------------------------------------------
 
 NS_IMETHODIMP nsDragService::GetNumDropItems(PRUint32 *aNumDropItems)
 {
   if (mSourceDataItems)
--- a/widget/src/os2/nsWindow.cpp
+++ b/widget/src/os2/nsWindow.cpp
@@ -1587,17 +1587,17 @@ NS_METHOD nsWindow::SetCursor(nsCursor a
       newPointer = ::WinQuerySysPointer(HWND_DESKTOP, SPTR_SIZEWE, FALSE);
       break;
   
     case eCursor_none:
       newPointer = gPtrArray[IDC_NONE-IDC_BASE];
       break;
   
     default:
-      NS_ASSERTION(0, "Invalid cursor type");
+      NS_ERROR("Invalid cursor type");
       break;
   }
 
   if (newPointer) {
     WinSetPointer(HWND_DESKTOP, newPointer);
   }
 
   return NS_OK;
--- a/widget/src/photon/nsWidget.cpp
+++ b/widget/src/photon/nsWidget.cpp
@@ -240,17 +240,17 @@ NS_METHOD nsWidget::Show( PRBool bState 
 			  return NS_OK;
 		  	}
 
 		  //EnableDamage( mWidget, PR_FALSE );
 		  PtRealizeWidget(mWidget);
 
 		  if( mWidget->rid == -1 ) {
 			  //EnableDamage( mWidget, PR_TRUE );
-			  NS_ASSERTION(0,"nsWidget::Show mWidget's rid == -1\n");
+			  NS_ERROR("nsWidget::Show mWidget's rid == -1\n");
 			  mShown = PR_FALSE; 
 			  return NS_ERROR_FAILURE;
 		  	}
 
 		  PtSetArg(&arg, Pt_ARG_FLAGS, 0, Pt_DELAY_REALIZE);
 		  PtSetResources(mWidget, 1, &arg);
 		  //EnableDamage( mWidget, PR_TRUE );
 		  PtDamageWidget(mWidget);
@@ -539,17 +539,17 @@ NS_METHOD nsWidget::SetCursor( nsCursor 
 		  curs = Ph_CURSOR_DRAG_HORIZONTAL;
 		  break;
 
 		case eCursor_none:
 		  // XXX: No suitable cursor, needs implementing
 		  break;
 
 		default:
-		  NS_ASSERTION(0, "Invalid cursor type");
+		  NS_ERROR("Invalid cursor type");
 		  break;
   		}
 
   	if( mWidget ) {
   	  PtArg_t args[2];
 
 			PtSetArg( &args[0], Pt_ARG_CURSOR_TYPE, curs, 0 );
 			PtSetArg( &args[1], Pt_ARG_CURSOR_COLOR, color, 0 );
--- a/widget/src/windows/nsFilePicker.cpp
+++ b/widget/src/windows/nsFilePicker.cpp
@@ -283,17 +283,17 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt1
       } 
 #ifdef WINCE_WINDOWS_MOBILE
       else if (mMode == modeGetFolder) {
         ofn.Flags = OFN_PROJECT | OFN_FILEMUSTEXIST;
         result = ::GetOpenFileNameW(&ofn);
       }
 #endif
       else {
-        NS_ASSERTION(0, "unsupported mode"); 
+        NS_ERROR("unsupported mode"); 
       }
 #ifndef WINCE
     }
     catch(...) {
       MessageBoxW(ofn.hwndOwner,
                   0,
                   L"The filepicker was unexpectedly closed by Windows.",
                   MB_ICONERROR);
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -892,17 +892,17 @@ DWORD nsWindow::WindowStyle()
            WS_THICKFRAME has issues with autohiding popups but looks better */
         style |= WS_THICKFRAME;
       } else {
         style |= WS_OVERLAPPED;
       }
       break;
 
     default:
-      NS_ASSERTION(0, "unknown border style");
+      NS_ERROR("unknown border style");
       // fall through
 
     case eWindowType_toplevel:
     case eWindowType_invisible:
       style = WS_OVERLAPPED | WS_BORDER | WS_DLGFRAME | WS_SYSMENU |
               WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
       break;
   }
@@ -926,17 +926,17 @@ DWORD nsWindow::WindowExStyle()
     case eWindowType_popup:
       return
 #if defined(WINCE) && !defined(WINCE_WINDOWS_MOBILE)
         WS_EX_NOACTIVATE |
 #endif
         WS_EX_TOPMOST | WS_EX_TOOLWINDOW;
 
     default:
-      NS_ASSERTION(0, "unknown border style");
+      NS_ERROR("unknown border style");
       // fall through
 
     case eWindowType_toplevel:
     case eWindowType_invisible:
       return WS_EX_WINDOWEDGE;
   }
 }
 
--- a/widget/src/windows/nsWindowCE.cpp
+++ b/widget/src/windows/nsWindowCE.cpp
@@ -287,17 +287,17 @@ DWORD nsWindow::WindowStyle()
 #endif
       break;
 
     case eWindowType_popup:
       style = WS_POPUP;
       break;
 
     default:
-      NS_ASSERTION(0, "unknown border style");
+      NS_ERROR("unknown border style");
       // fall through
 
     case eWindowType_toplevel:
     case eWindowType_invisible:
       style = WS_BORDER;
 #if !defined(WINCE_WINDOWS_MOBILE)
       style |= WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
 #endif
--- a/xpcom/base/nsMemoryImpl.cpp
+++ b/xpcom/base/nsMemoryImpl.cpp
@@ -87,28 +87,28 @@ const char* kHighMark = "/sys/kernel/hig
 PRUint32 gFlushFreq = 0;
 PRUint32 gFailFreq = 0;
 
 static void*
 mallocator(PRSize size, PRUint32& counter, PRUint32 max)
 {
     if (counter++ >= max) {
         counter = 0;
-        NS_ASSERTION(0, "about to fail allocation... watch out");
+        NS_ERROR("about to fail allocation... watch out");
         return nsnull;
     }
     return PR_Malloc(size);
 }
 
 static void*
 reallocator(void* ptr, PRSize size, PRUint32& counter, PRUint32 max)
 {
     if (counter++ >= max) {
         counter = 0;
-        NS_ASSERTION(0, "about to fail reallocation... watch out");
+        NS_ERROR("about to fail reallocation... watch out");
         return nsnull;
     }
     return PR_Realloc(ptr, size);
 }
 
 #define MALLOC1(s)       mallocator(s, gFlushFreq, NS_FLUSH_FREQUENCY)
 #define REALLOC1(p, s)   reallocator(p, s, gFlushFreq, NS_FLUSH_FREQUENCY)
 
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -3184,17 +3184,17 @@ nsComponentManagerImpl::AutoUnregisterCo
 }
 
 NS_IMETHODIMP
 nsComponentManagerImpl::IsRegistered(const nsCID &aClass,
                                      PRBool *aRegistered)
 {
     if (!aRegistered)
     {
-        NS_ASSERTION(0, "null ptr");
+        NS_ERROR("null ptr");
         return NS_ERROR_NULL_POINTER;
     }
     *aRegistered = (nsnull != GetFactoryEntry(aClass));
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsComponentManagerImpl::EnumerateCLSIDs(nsIEnumerator** aEnumerator)
--- a/xpcom/obsolete/nsFileSpec.cpp
+++ b/xpcom/obsolete/nsFileSpec.cpp
@@ -791,17 +791,17 @@ nsFilePath nsFilePath::operator +(const 
 //                                nsFileSpec implementation
 //========================================================================================
 
 //----------------------------------------------------------------------------------------
 nsFileSpec::nsFileSpec()
 //----------------------------------------------------------------------------------------
 :    mError(NS_OK)		// XXX shouldn't this be NS_ERROR_NOT_INITIALIZED?
 {
-//    NS_ASSERTION(0, "nsFileSpec is unsupported - use nsIFile!");
+//    NS_ERROR("nsFileSpec is unsupported - use nsIFile!");
 }
 
 //----------------------------------------------------------------------------------------
 void nsFileSpec::Clear()
 //----------------------------------------------------------------------------------------
 {
     mPath.SetToEmpty();
     mError = NS_ERROR_NOT_INITIALIZED;
@@ -911,17 +911,17 @@ void nsFileSpec::operator = (const nsPer
 
 #if (defined XP_UNIX || defined XP_BEOS)
 //----------------------------------------------------------------------------------------
 nsFileSpec::nsFileSpec(const nsFilePath& inPath)
 //----------------------------------------------------------------------------------------
 :    mPath((const char*)inPath)
 ,    mError(NS_OK)
 {
-//    NS_ASSERTION(0, "nsFileSpec is unsupported - use nsIFile!");
+//    NS_ERROR("nsFileSpec is unsupported - use nsIFile!");
 }
 
 //----------------------------------------------------------------------------------------
 void nsFileSpec::operator = (const nsFilePath& inPath)
 //----------------------------------------------------------------------------------------
 {
     mPath = (const char*)inPath;
     mError = NS_OK;
@@ -930,37 +930,37 @@ void nsFileSpec::operator = (const nsFil
 
 #if (defined(XP_UNIX) || defined(XP_WIN) || defined(XP_OS2) || defined(XP_BEOS))
 //----------------------------------------------------------------------------------------
 nsFileSpec::nsFileSpec(const nsFileSpec& inSpec)
 //----------------------------------------------------------------------------------------
 :    mPath(inSpec.mPath)
 ,    mError(NS_OK)
 {
-//    NS_ASSERTION(0, "nsFileSpec is unsupported - use nsIFile!");
+//    NS_ERROR("nsFileSpec is unsupported - use nsIFile!");
 }
 
 //----------------------------------------------------------------------------------------
 nsFileSpec::nsFileSpec(const char* inString, PRBool inCreateDirs)
 //----------------------------------------------------------------------------------------
 :    mPath(inString)
 ,    mError(NS_OK)
 {
-//    NS_ASSERTION(0, "nsFileSpec is unsupported - use nsIFile!");
+//    NS_ERROR("nsFileSpec is unsupported - use nsIFile!");
     // Make canonical and absolute.
     nsFileSpecHelpers::Canonify(mPath, inCreateDirs);
 }
 
 //----------------------------------------------------------------------------------------
 nsFileSpec::nsFileSpec(const nsString& inString, PRBool inCreateDirs)
 //----------------------------------------------------------------------------------------
 :    mPath(inString)
 ,    mError(NS_OK)
 {
-//    NS_ASSERTION(0, "nsFileSpec is unsupported - use nsIFile!");
+//    NS_ERROR("nsFileSpec is unsupported - use nsIFile!");
     // Make canonical and absolute.
     nsFileSpecHelpers::Canonify(mPath, inCreateDirs);
 }
 
 //----------------------------------------------------------------------------------------
 void nsFileSpec::operator = (const nsFileSpec& inSpec)
 //----------------------------------------------------------------------------------------
 {
--- a/xpcom/obsolete/nsFileSpecImpl.cpp
+++ b/xpcom/obsolete/nsFileSpecImpl.cpp
@@ -57,28 +57,28 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(nsFileSpec
 #endif
 
 //----------------------------------------------------------------------------------------
 nsFileSpecImpl::nsFileSpecImpl()
 //----------------------------------------------------------------------------------------
 	:	mInputStream(nsnull)
 	,	mOutputStream(nsnull)
 {
-//    NS_ASSERTION(0, "nsFileSpec is unsupported - use nsIFile!");
+//    NS_ERROR("nsFileSpec is unsupported - use nsIFile!");
 
 }
 
 //----------------------------------------------------------------------------------------
 nsFileSpecImpl::nsFileSpecImpl(const nsFileSpec& inSpec)
 //----------------------------------------------------------------------------------------
 	:	mFileSpec(inSpec)
 	,	mInputStream(nsnull)
 	,	mOutputStream(nsnull)
 {
-//    NS_ASSERTION(0, "nsFileSpec is unsupported - use nsIFile!");
+//    NS_ERROR("nsFileSpec is unsupported - use nsIFile!");
 
 }
 
 //----------------------------------------------------------------------------------------
 nsFileSpecImpl::~nsFileSpecImpl()
 //----------------------------------------------------------------------------------------
 {
 	CloseStream();
--- a/xpcom/obsolete/nsFileSpecOS2.cpp
+++ b/xpcom/obsolete/nsFileSpecOS2.cpp
@@ -201,17 +201,17 @@ void nsFileSpecHelpers::NativeToUnix(nsS
 	temp += ioPath;
 	ioPath = temp;
 }
 
 //----------------------------------------------------------------------------------------
 nsFileSpec::nsFileSpec(const nsFilePath& inPath)
 //----------------------------------------------------------------------------------------
 {
-//    NS_ASSERTION(0, "nsFileSpec is unsupported - use nsIFile!");
+//    NS_ERROR("nsFileSpec is unsupported - use nsIFile!");
 	*this = inPath;
 }
 
 //----------------------------------------------------------------------------------------
 void nsFileSpec::operator = (const nsFilePath& inPath)
 //----------------------------------------------------------------------------------------
 {
 	mPath = (const char*)inPath;
--- a/xpcom/obsolete/nsFileSpecWin.cpp
+++ b/xpcom/obsolete/nsFileSpecWin.cpp
@@ -177,17 +177,17 @@ void nsFileSpecHelpers::NativeToUnix(nsS
 	temp += ioPath;
 	ioPath = temp;
 }
 
 //----------------------------------------------------------------------------------------
 nsFileSpec::nsFileSpec(const nsFilePath& inPath)
 //----------------------------------------------------------------------------------------
 {
-//    NS_ASSERTION(0, "nsFileSpec is unsupported - use nsIFile!");
+//    NS_ERROR("nsFileSpec is unsupported - use nsIFile!");
 	*this = inPath;
 }
 
 //----------------------------------------------------------------------------------------
 void nsFileSpec::operator = (const nsFilePath& inPath)
 //----------------------------------------------------------------------------------------
 {
 	mPath = (const char*)inPath;
--- a/xpcom/reflect/xptcall/src/md/os2/xptcstubs_gcc_x86_os2.cpp
+++ b/xpcom/reflect/xptcall/src/md/os2/xptcstubs_gcc_x86_os2.cpp
@@ -145,17 +145,17 @@ asm(".text\n\t"
     "leal	0x08(%esp), %ecx\n\t"
     "movl	0x04(%esp), %edx\n\t"
     "jmp	" SYMBOL_UNDERSCORE "PrepareAndDispatch\n\t"
     ".size	" SYMBOL_UNDERSCORE "SharedStub,.-" SYMBOL_UNDERSCORE "SharedStub");
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 void
 xptc_dummy()
 {
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_alpha_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_alpha_openbsd.cpp
@@ -114,17 +114,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
             // doubles passed via registers are also stored
             // in the first NUM_ARG_REGS entries in args
             dp->val.u64 = (i < NUM_ARG_REGS) ? args[i] : *ap;
             break;
         case nsXPTType::T_BOOL   : dp->val.b   = (PRBool)    *ap;    break;
         case nsXPTType::T_CHAR   : dp->val.c   = (char)      *ap;    break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = (PRUnichar) *ap;    break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -221,13 +221,13 @@ symbol ":"                    "\n\t" \
     STUB_MANGLED_ENTRY(n, "Stub"#n"__14nsXPTCStubBase") \
     );
 
 #endif /* G++ V3 ABI */
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_openbsd.cpp
@@ -138,17 +138,17 @@ PrepareAndDispatch(nsXPTCStubBase * self
         case nsXPTType::T_U16:     dp->val.u16 = (PRUint16) value; break;
         case nsXPTType::T_U32:     dp->val.u32 = (PRUint32) value; break;
         case nsXPTType::T_U64:     dp->val.u64 = (PRUint64) value; break;
         case nsXPTType::T_BOOL:    dp->val.b   = (PRBool)   value; break;
         case nsXPTType::T_CHAR:    dp->val.c   = (char)     value; break;
         case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  value; break;
 
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16) methodIndex, info, dispatchParams);
 
     if (dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -222,17 +222,17 @@ asm(".section   \".text\"\n\t"
     "call       PrepareAndDispatch@plt\n\t"
     "leave\n\t"
     "ret\n\t"
     ".size      SharedStub,.-SharedStub");
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #else
 #error "Unsupported compiler. Use gcc >= 3.1 for Linux/x86-64."
 #endif /* __GNUC__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
@@ -119,17 +119,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 				   dp->val.u64 = *((PRUint64*)ap); ap++; break;
         case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
         case nsXPTType::T_DOUBLE : ap = DOUBLEWORD_ALIGN(ap);
 				   dp->val.d   = *((double*)  ap); ap++; break;
         case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
         case nsXPTType::T_CHAR   : dp->val.c   = *((char*)    ap);       break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = *((wchar_t*) ap);       break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -250,13 +250,13 @@ nsresult nsXPTCStubBase::Stub##n ()  \
 "	mov	ip, #"#n"\n"					\
 "	b	SharedStub\n\t");
 
 #endif
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp
@@ -93,17 +93,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
         case nsXPTType::T_U64    : dp->val.u64 = *((PRUint64*)ap); ap++; break;
         case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
         case nsXPTType::T_DOUBLE : dp->val.d   = *((double*)  ap); ap++; break;
         case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
         case nsXPTType::T_CHAR   : dp->val.c   = *((char*)    ap);       break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = *((wchar_t*) ap);       break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     NS_RELEASE(iface_info);
 
@@ -133,13 +133,13 @@ PrepareAndDispatch(nsXPTCStubBase* self,
     "ldmea	fp, {fp, sp, lr}	\n\t"				\
     "add	sp, sp, #12		\n\t"				\
     "mov	pc, lr			\n\t"				\
 );
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
@@ -109,17 +109,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
         case nsXPTType::T_U64    : dp->val.u64 = *((PRUint64*)ap); ap++; break;
         case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
         case nsXPTType::T_DOUBLE : dp->val.d   = *((double*)  ap); ap++; break;
         case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
         case nsXPTType::T_CHAR   : dp->val.c   = *((char*)    ap);       break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = *((wchar_t*) ap);       break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -240,13 +240,13 @@ nsresult nsXPTCStubBase::Stub##n ()  \
 "	mov	ip, #"#n"\n"					\
 "	b	SharedStub\n\t");
 
 #endif
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
@@ -172,17 +172,17 @@ asm(".text\n\t"
     "leal	0x08(%esp), %ecx\n\t"
     "movl	0x04(%esp), %edx\n\t"
     "jmp	" SYMBOL_UNDERSCORE "PrepareAndDispatch\n\t"
     ".size	" SYMBOL_UNDERSCORE "SharedStub,.-" SYMBOL_UNDERSCORE "SharedStub");
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 void
 xptc_dummy()
 {
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ipf32.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ipf32.cpp
@@ -119,17 +119,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
     case nsXPTType::T_DOUBLE :
       isfloat = 1;
       dp->val.u64 = *(fargs);
       break;
     case nsXPTType::T_BOOL   : dp->val.b   = *(iargs); break;
     case nsXPTType::T_CHAR   : dp->val.c   = *(iargs); break;
     case nsXPTType::T_WCHAR  : dp->val.wc  = *(iargs); break;
     default:
-      NS_ASSERTION(0, "bad type");
+      NS_ERROR("bad type");
       break;
     }
     if (i < 7)
     {
       /* we are parsing register arguments */
       if (i == 6)
       {
         // run out of register arguments, move on to memory arguments
@@ -170,14 +170,14 @@ PRUint64 a2,PRUint64 a3,PRUint64 a4,PRUi
 PRUint64 a8) \
 { uint64_t a0 = (uint64_t) this; \
  return SharedStub(a0,a1,a2,a3,a4,a5,a6,a7,(PRUint64) n, &a8); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ipf64.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ipf64.cpp
@@ -122,17 +122,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
     case nsXPTType::T_DOUBLE :
       isfloat = 1;
       dp->val.u64 = *(fargs);
       break;
     case nsXPTType::T_BOOL   : dp->val.b   = *(iargs); break;
     case nsXPTType::T_CHAR   : dp->val.c   = *(iargs); break;
     case nsXPTType::T_WCHAR  : dp->val.wc  = *(iargs); break;
     default:
-      NS_ASSERTION(0, "bad type");
+      NS_ERROR("bad type");
       break;
     }
     if (i < 7)
     {
       /* we are parsing register arguments */
       if (i == 6)
       {
         // run out of register arguments, move on to memory arguments
@@ -173,14 +173,14 @@ PRUint64 a2,PRUint64 a3,PRUint64 a4,PRUi
 PRUint64 a8) \
 { uint64_t a0 = (uint64_t) this; \
  return SharedStub(a0,a1,a2,a3,a4,a5,a6,a7,(PRUint64) n, &a8); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_irix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_irix.cpp
@@ -192,17 +192,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_WCHAR:
            if (iCount < PARAM_GPR_COUNT)
               dp->val.wc  = (wchar_t)gprData[iCount++];
            else
               dp->val.wc  = (wchar_t)*ap++;
            break;
 
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     NS_RELEASE(iface_info);
 
@@ -212,15 +212,15 @@ PrepareAndDispatch(nsXPTCStubBase* self,
     return result;
 }
 
 #define STUB_ENTRY(n)		/* defined in the assembly file */
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #endif
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp
@@ -111,17 +111,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
             // doubles passed via registers are also stored
             // in the first NUM_ARG_REGS entries in args
             dp->val.u64 = (i < NUM_ARG_REGS) ? args[i] : *ap;
             break;
         case nsXPTType::T_BOOL   : dp->val.b   = (PRBool)    *ap;    break;
         case nsXPTType::T_CHAR   : dp->val.c   = (char)      *ap;    break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = (PRUnichar) *ap;    break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -218,13 +218,13 @@ symbol ":"                    "\n\t" \
     STUB_MANGLED_ENTRY(n, "Stub"#n"__14nsXPTCStubBase") \
     );
 
 #endif /* G++ V3 ABI */
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp
@@ -94,17 +94,17 @@ extern "C" {
             case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
             case nsXPTType::T_U64    : dp->val.u64 = *((PRUint64*)ap); ap++; break;
             case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
             case nsXPTType::T_DOUBLE : dp->val.d   = *((double*)  ap); ap++; break;
             case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
             case nsXPTType::T_CHAR   : dp->val.c   = *(((char*)   ap) + 3);  break;
             case nsXPTType::T_WCHAR  : dp->val.wc  = *((wchar_t*) ap);       break;
             default:
-                NS_ASSERTION(0, "bad type");
+                NS_ERROR("bad type");
                 break;
             }
         }
 
         result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
         if(dispatchParams != paramBuffer)
             delete [] dispatchParams;
@@ -118,13 +118,13 @@ nsresult nsXPTCStubBase::Stub##n() \
 { \
   void *frame = __builtin_frame_address(0); \
   return PrepareAndDispatch(this, n, (uint32*)frame + 3); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390.cpp
@@ -161,17 +161,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
             break;
         case nsXPTType::T_WCHAR  : 
             if (gpr < 5)
                 dp->val.wc  = *((PRUint32*)a_gpr), a_gpr++, gpr++;
             else
                 dp->val.wc  = *((PRUint32*)a_ov ), a_ov++;
             break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -202,14 +202,14 @@ nsresult nsXPTCStubBase::Stub##n() \
     );                        \
                               \
     return PrepareAndDispatch(this, n, a_gpr, a_fpr, a_ov); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390x.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390x.cpp
@@ -161,17 +161,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
             break;
         case nsXPTType::T_WCHAR  : 
             if (gpr < 5)
                 dp->val.wc  = *((PRUint64*)a_gpr), a_gpr++, gpr++;
             else
                 dp->val.wc  = *((PRUint64*)a_ov ), a_ov++;
             break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -206,14 +206,14 @@ nsresult nsXPTCStubBase::Stub##n() \
     );                        \
                               \
     return PrepareAndDispatch(this, n, a_gpr, a_fpr, a_ov); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp
@@ -114,13 +114,13 @@ PrepareAndDispatch(nsXPTCStubBase* self,
     return result;
 }
 
 #define STUB_ENTRY(n) // done in the .s file
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp
@@ -102,17 +102,17 @@ extern "C" {
             case nsXPTType::T_U64    : dp->val.u64 = *((PRUint64*)ap); ap++; break;
             case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
             case nsXPTType::T_DOUBLE : dp->val.d   = *((double*)  ap); ap++; break;
             case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
             case nsXPTType::T_CHAR   : dp->val.c   = *(((char*)   ap) + 3);  break;
             // wchar_t is an int (32 bits) on NetBSD
             case nsXPTType::T_WCHAR  : dp->val.wc  = *((wchar_t*) ap);       break;
             default:
-                NS_ASSERTION(0, "bad type");
+                NS_ERROR("bad type");
                 break;
             }
         }
 
         result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
         NS_RELEASE(iface_info);
 
@@ -135,13 +135,13 @@ extern "C" {
     "jbsr  _PrepareAndDispatch		\n\t"				\
     "unlk  a6				\n\t"				\
     "rts				\n\t"				\
 );
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_arm.cpp
@@ -101,17 +101,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
         case nsXPTType::T_U64    : dp->val.u64 = *((PRUint64*)ap); ap++; break;
         case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
         case nsXPTType::T_DOUBLE : dp->val.d   = *((double*)  ap); ap++; break;
         case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
         case nsXPTType::T_CHAR   : dp->val.c   = *((char*)    ap);       break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = *((wchar_t*) ap);       break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     NS_RELEASE(iface_info);
 
@@ -232,13 +232,13 @@ nsresult nsXPTCStubBase::Stub##n ()  \
 "	mov	ip, #"#n"\n"					\
 "	b	SharedStub\n\t");
 
 #endif
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_shle.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_shle.cpp
@@ -124,17 +124,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
    nothing.  Defining the stubs as assembler here unnecessarily painful and
    larger than necessary since gcc won't give use naked functions.
 */
 #define STUB_ENTRY(n)
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-	NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+	NS_ERROR("nsXPTCStubBase::Sentinel called"); \
 	return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #else
 #error "can't find a compiler to use"
 #endif /* __GNUC__ */
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_openvms_alpha.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_openvms_alpha.cpp
@@ -111,17 +111,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
             // doubles passed via registers are also stored
             // in the first NUM_ARG_REGS entries in args
             dp->val.u64 = (i < NUM_ARG_REGS) ? args[i] : *ap;
             break;
         case nsXPTType::T_BOOL   : dp->val.b   = (PRBool)    *ap; break;
         case nsXPTType::T_CHAR   : dp->val.c   = (char)      *ap; break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = (PRUnichar) *ap; break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     NS_RELEASE(iface_info);
 
@@ -133,15 +133,15 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 
 }
 
 #define STUB_ENTRY(n)  /* This is in the ASM file */
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_osf1_alpha.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_osf1_alpha.cpp
@@ -111,17 +111,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
             // doubles passed via registers are also stored
             // in the first NUM_ARG_REGS entries in args
             dp->val.u64 = (i < NUM_ARG_REGS) ? args[i] : *ap;
             break;
         case nsXPTType::T_BOOL   : dp->val.b   = (PRBool)    *ap;    break;
         case nsXPTType::T_CHAR   : dp->val.c   = (char)      *ap;    break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = (PRUnichar) *ap;    break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     NS_RELEASE(iface_info);
 
@@ -136,14 +136,14 @@ PrepareAndDispatch(nsXPTCStubBase* self,
  *  Sets arguments to registers and calls PrepareAndDispatch.
  *  This is defined in the ASM file.
  */
 #define STUB_ENTRY(n) \
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp
@@ -137,17 +137,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
                                break;
     case nsXPTType::T_U8     : dp->val.u8  = *((PRUint32*) args); break;
     case nsXPTType::T_U16    : dp->val.u16 = *((PRUint32*) args); break;
     case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*) args); break;
     case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)   args); break;
     case nsXPTType::T_CHAR   : dp->val.c   = *((PRUint32*) args); break;
     case nsXPTType::T_WCHAR  : dp->val.wc  = *((PRInt32*)  args); break;
     default:
-      NS_ASSERTION(0, "bad type");
+      NS_ERROR("bad type");
       break;
     }
     ++regwords;
   }
 
   result = self->mOuter->CallMethod((PRUint16) methodIndex, info, dispatchParams); 
 
   if(dispatchParams != paramBuffer)
@@ -162,14 +162,14 @@ extern "C" int SharedStub(int);
 nsresult nsXPTCStubBase::Stub##n()  \
 {                           \
     return SharedStub(n);   \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp
@@ -148,17 +148,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
                 dp->val.u64 = (PRUint64) tempu64;
             else if (type == nsXPTType::T_BOOL)
                 dp->val.b   = (PRBool)   tempu64;
             else if (type == nsXPTType::T_CHAR)
                 dp->val.c   = (char)     tempu64;
             else if (type == nsXPTType::T_WCHAR)
                 dp->val.wc  = (wchar_t)  tempu64;
             else
-                NS_ASSERTION(0, "bad type");
+                NS_ERROR("bad type");
         }
 
         if (i >= 7)
             ap++;
     }
 
     result = self->mOuter->CallMethod((PRUint16) methodIndex, info,
                                       dispatchParams);
@@ -233,13 +233,13 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         "li     11,"#n" \n\t"                                           \
         "b      SharedStub \n"                                          \
 );
 #endif
 
 #define SENTINEL_ENTRY(n)                                               \
 nsresult nsXPTCStubBase::Sentinel##n()                                  \
 {                                                                       \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called");                  \
+    NS_ERROR("nsXPTCStubBase::Sentinel called");                  \
     return NS_ERROR_NOT_IMPLEMENTED;                                    \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_aix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_aix.cpp
@@ -185,17 +185,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
                                          dp->val.c  = (char)  *ap++;
                                      break;
         case nsXPTType::T_WCHAR   :  if (iCount < PARAM_GPR_COUNT)
                                          dp->val.wc  = (wchar_t) gprData[iCount++];
                                      else
                                          dp->val.wc  = (wchar_t)  *ap++;
                                      break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex,info,dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -203,15 +203,15 @@ PrepareAndDispatch(nsXPTCStubBase* self,
     return result;
 }
 
 #define STUB_ENTRY(n)
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #endif /* AIX */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_aix64.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_aix64.cpp
@@ -172,17 +172,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
                                          dp->val.c  = (char)  *ap++;
                                      break;
         case nsXPTType::T_WCHAR   :  if (iCount < PARAM_GPR_COUNT)
                                          dp->val.wc  = (wchar_t) gprData[iCount++];
                                      else
                                          dp->val.wc  = (wchar_t)  *ap++;
                                      break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex,info,dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -190,15 +190,15 @@ PrepareAndDispatch(nsXPTCStubBase* self,
     return result;
 }
 
 #define STUB_ENTRY(n)
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #endif /* AIX */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_linux.cpp
@@ -158,17 +158,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U16:     dp->val.u16 = (PRUint16) tempu32; break;
         case nsXPTType::T_U32:     dp->val.u32 = (PRUint32) tempu32; break;
         case nsXPTType::T_U64:     dp->val.u64 = (PRUint64) tempu64; break;
         case nsXPTType::T_BOOL:    dp->val.b   = (PRBool)   tempu32; break;
         case nsXPTType::T_CHAR:    dp->val.c   = (char)     tempu32; break;
         case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  tempu32; break;
 
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex,
                                       info,
                                       dispatchParams);
 
@@ -236,13 +236,13 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 	"li	11,"#n" \n\t"						\
 	"b	SharedStub@local \n"					\
 );
 #endif
 
 #define SENTINEL_ENTRY(n)                            \
 nsresult nsXPTCStubBase::Sentinel##n()               \
 {                                                    \
-  NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+  NS_ERROR("nsXPTCStubBase::Sentinel called"); \
   return NS_ERROR_NOT_IMPLEMENTED;                   \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_netbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_netbsd.cpp
@@ -169,17 +169,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U16:     dp->val.u16 = (PRUint16) tempu32; break;
         case nsXPTType::T_U32:     dp->val.u32 = (PRUint32) tempu32; break;
         case nsXPTType::T_U64:     dp->val.u64 = (PRUint64) tempu64; break;
         case nsXPTType::T_BOOL:    dp->val.b   = (PRBool)   tempu32; break;
         case nsXPTType::T_CHAR:    dp->val.c   = (char)     tempu32; break;
         case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  tempu32; break;
 
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->CallMethod((PRUint16) methodIndex, info, dispatchParams);
 
     NS_RELEASE(iface_info);
 
@@ -205,13 +205,13 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 "Stub"#n"__14nsXPTCStubBase: \n\t"                          \
 	"li     11,"#n" \n\t"                               \
 	"b      SharedStub@local \n"                        \
 );
 
 #define SENTINEL_ENTRY(n)                            \
 nsresult nsXPTCStubBase::Sentinel##n()               \
 {                                                    \
-  NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+  NS_ERROR("nsXPTCStubBase::Sentinel called"); \
   return NS_ERROR_NOT_IMPLEMENTED;                   \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_openbsd.cpp
@@ -158,17 +158,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U16:     dp->val.u16 = (PRUint16) tempu32; break;
         case nsXPTType::T_U32:     dp->val.u32 = (PRUint32) tempu32; break;
         case nsXPTType::T_U64:     dp->val.u64 = (PRUint64) tempu64; break;
         case nsXPTType::T_BOOL:    dp->val.b   = (PRBool)   tempu32; break;
         case nsXPTType::T_CHAR:    dp->val.c   = (char)     tempu32; break;
         case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  tempu32; break;
 
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex,
                                       info,
                                       dispatchParams);
 
@@ -236,13 +236,13 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 	"li	11,"#n" \n\t"						\
 	"b	SharedStub@local \n"					\
 );
 #endif
 
 #define SENTINEL_ENTRY(n)                            \
 nsresult nsXPTCStubBase::Sentinel##n()               \
 {                                                    \
-  NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+  NS_ERROR("nsXPTCStubBase::Sentinel called"); \
   return NS_ERROR_NOT_IMPLEMENTED;                   \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_rhapsody.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_rhapsody.cpp
@@ -167,17 +167,17 @@ PrepareAndDispatch(
         case nsXPTType::T_DOUBLE:
           if(fprIndex < PARAM_FPR_COUNT)
             dp->val.d = argsFPR[fprIndex++];
           else
             dp->val.d = *(double *) &argsStack[argIndex];
           argIndex++;
           break;
         default:
-          NS_ASSERTION(0, "bad type");
+          NS_ERROR("bad type");
           break;
       }
     }
   }
 
   result = self->mOuter->
     CallMethod((PRUint16)methodIndex, methodInfo, dispatchParams);
 
@@ -186,13 +186,13 @@ PrepareAndDispatch(
 
   return result;
 }
 
 #define STUB_ENTRY(n)
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_openbsd.cpp
@@ -99,17 +99,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_I64    : dp->val.i64 = *((PRInt64*) ap);       break;
         case nsXPTType::T_U8     : dp->val.u8  = *((PRUint64*) ap);      break;
         case nsXPTType::T_U16    : dp->val.u16 = *((PRUint64*)ap);       break;
         case nsXPTType::T_U32    : dp->val.u32 = *((PRUint64*)ap);       break;
         case nsXPTType::T_U64    : dp->val.u64 = *((PRUint64*) ap);      break;
         case nsXPTType::T_FLOAT  : dp->val.f   = ((float*)   ap)[1];     break;
         case nsXPTType::T_DOUBLE : dp->val.d   = *((double*) ap);        break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -124,15 +124,15 @@ nsresult nsXPTCStubBase::Stub##n() \
 { \
 	int dummy; /* defeat tail-call optimization */ \
 	return SharedStub(n, &dummy); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #endif /* sparc || __sparc__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp
@@ -105,17 +105,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U8     : dp->val.u8  = *((PRUint32*) ap);       break;
         case nsXPTType::T_U16    : dp->val.u16 = *((PRUint32*)ap);       break;
         case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
         case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
         case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
         case nsXPTType::T_CHAR   : dp->val.c   = *((PRUint32*) ap);       break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = *((PRInt32*) ap);       break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     NS_RELEASE(iface_info);
 
@@ -132,15 +132,15 @@ nsresult nsXPTCStubBase::Stub##n() \
 { \
 	int dummy; /* defeat tail-call optimization */ \
 	return SharedStub(n, &dummy); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #endif /* sparc || __sparc__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp
@@ -108,17 +108,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U8     : dp->val.u8  = *((PRUint32*) ap);       break;
         case nsXPTType::T_U16    : dp->val.u16 = *((PRUint32*)ap);       break;
         case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
         case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
         case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
         case nsXPTType::T_CHAR   : dp->val.c   = *((PRUint32*) ap);       break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = *((PRInt32*) ap);       break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     NS_RELEASE(iface_info);
 
@@ -135,15 +135,15 @@ nsresult nsXPTCStubBase::Stub##n() \
 { \
 	int dummy; /* defeat tail-call optimization */ \
 	return SharedStub(n, &dummy); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #endif /* sparc || __sparc__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp
@@ -102,17 +102,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U8     : dp->val.u8  = *((PRUint32*) ap);       break;
         case nsXPTType::T_U16    : dp->val.u16 = *((PRUint32*)ap);       break;
         case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
         case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
         case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
         case nsXPTType::T_CHAR   : dp->val.c   = *((PRUint32*) ap);       break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = *((PRInt32*) ap);       break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -127,15 +127,15 @@ nsresult nsXPTCStubBase::Stub##n() \
 { \
 	int dummy; /* defeat tail-call optimization */ \
 	return SharedStub(n, &dummy); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #endif /* sparc || __sparc__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparcv9_solaris.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparcv9_solaris.cpp
@@ -96,17 +96,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U8     : dp->val.u8  = *((PRUint32*) ap);      break;
         case nsXPTType::T_U16    : dp->val.u16 = *((PRUint32*)ap);       break;
         case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
         case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
         case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
         case nsXPTType::T_CHAR   : dp->val.c   = *((PRUint32*) ap);      break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = *((PRInt32*) ap);       break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -121,15 +121,15 @@ nsresult nsXPTCStubBase::Stub##n() \
 { \
 	int dummy; /* defeat tail-call optimization */ \
 	return SharedStub(n, &dummy); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #endif /* sparc || __sparc__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp
@@ -164,13 +164,13 @@ nsresult nsXPTCStubBase::Stub##n() \
 
 #else
 #error "can't find a compiler to use"
 #endif /* __GNUC__ */
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp
@@ -140,17 +140,17 @@ PrepareAndDispatch(nsXPTCStubBase * self
         case nsXPTType::T_U16:     dp->val.u16 = (PRUint16) value; break;
         case nsXPTType::T_U32:     dp->val.u32 = (PRUint32) value; break;
         case nsXPTType::T_U64:     dp->val.u64 = (PRUint64) value; break;
         case nsXPTType::T_BOOL:    dp->val.b   = (PRBool)   value; break;
         case nsXPTType::T_CHAR:    dp->val.c   = (char)     value; break;
         case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  value; break;
 
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16) methodIndex, info, dispatchParams);
 
     if (dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -209,17 +209,17 @@ asm(".section   \".text\",regular\n\t"
     "leaq       16(%rbp),%rdx\n\t"
     "call       _PrepareAndDispatch\n\t"
     "leave\n\t"
     "ret\n\t");
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #else
 #error "Unsupported compiler. Use gcc >= 4.2 for Darwin/x86-64."
 #endif /* __GNUC__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
@@ -140,17 +140,17 @@ PrepareAndDispatch(nsXPTCStubBase * self
         case nsXPTType::T_U16:     dp->val.u16 = (PRUint16) value; break;
         case nsXPTType::T_U32:     dp->val.u32 = (PRUint32) value; break;
         case nsXPTType::T_U64:     dp->val.u64 = (PRUint64) value; break;
         case nsXPTType::T_BOOL:    dp->val.b   = (PRBool)   value; break;
         case nsXPTType::T_CHAR:    dp->val.c   = (char)     value; break;
         case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  value; break;
 
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16) methodIndex, info, dispatchParams);
 
     if (dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -224,17 +224,17 @@ asm(".section   \".text\"\n\t"
     "call       PrepareAndDispatch@plt\n\t"
     "leave\n\t"
     "ret\n\t"
     ".size      SharedStub,.-SharedStub");
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 #else
 #error "Unsupported compiler. Use gcc >= 3.1 for Linux/x86-64."
 #endif /* __GNUC__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.cpp
@@ -130,13 +130,13 @@ nsresult nsXPTCStubBase::Stub##n() \
 
 #else
 #error "can't find a compiler to use"
 #endif /* __GNUC__ */
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/win32/xptcstubs.cpp
+++ b/xpcom/reflect/xptcall/src/md/win32/xptcstubs.cpp
@@ -100,17 +100,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
         case nsXPTType::T_U64    : dp->val.u64 = *((PRUint64*)ap); ap++; break;
         case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
         case nsXPTType::T_DOUBLE : dp->val.d   = *((double*)  ap); ap++; break;
         case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
         case nsXPTType::T_CHAR   : dp->val.c   = *((char*)    ap);       break;
         case nsXPTType::T_WCHAR  : dp->val.wc  = *((wchar_t*) ap);       break;
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
     *stackBytesToPop = ((PRUint32)ap) - ((PRUint32)args);
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
@@ -171,17 +171,17 @@ nsresult __stdcall nsXPTCStubBase::Stub#
   return result; \
 }   
 
 #endif /* __GNUC__ */
 
 #define SENTINEL_ENTRY(n) \
 nsresult __stdcall nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #ifdef _MSC_VER
 #pragma warning(disable : 4035) // OK to have no return value
 #endif
 #include "xptcstubsdef.inc"
 #ifdef _MSC_VER
--- a/xpcom/reflect/xptcall/src/md/win32/xptcstubs_alpha.cpp
+++ b/xpcom/reflect/xptcall/src/md/win32/xptcstubs_alpha.cpp
@@ -190,17 +190,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_WCHAR:
            if (iCount < PARAM_GPR_COUNT)
               dp->val.wc  = (wchar_t)gprData[iCount++];
            else
               dp->val.wc  = *((wchar_t*)ap++);
            break;
 
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     NS_RELEASE(iface_info);
 
@@ -210,17 +210,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
     return result;
 }
 
 #define STUB_ENTRY(n)  /* defined in the assembly file */
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 void
 xptc_dummy()
 {
--- a/xpcom/reflect/xptcall/src/md/win32/xptcstubs_x86_64.cpp
+++ b/xpcom/reflect/xptcall/src/md/win32/xptcstubs_x86_64.cpp
@@ -188,17 +188,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_WCHAR:
            if (iCount < PARAM_GPR_COUNT)
               dp->val.wc  = (wchar_t)gprData[iCount++];
            else
               dp->val.wc  = *((wchar_t*)ap++);
            break;
 
         default:
-            NS_ASSERTION(0, "bad type");
+            NS_ERROR("bad type");
             break;
         }
     }
 
     result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
@@ -206,17 +206,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
     return result;
 }
 
 #define STUB_ENTRY(n)  /* defined in the assembly file */
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
 
 void
 xptc_dummy()
 {
--- a/xpcom/reflect/xptcall/src/md/win32/xptcstubsce.cpp
+++ b/xpcom/reflect/xptcall/src/md/win32/xptcstubsce.cpp
@@ -96,17 +96,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 			case nsXPTType::T_U32    : dp->val.u32 = *((PRUint32*)ap);       break;
 			case nsXPTType::T_U64    : dp->val.u64 = *((PRUint64*)ap); ap++; break;
 			case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
 			case nsXPTType::T_DOUBLE : dp->val.d   = *((double*)  ap); ap++; break;
 			case nsXPTType::T_BOOL   : dp->val.b   = *((PRBool*)  ap);       break;
 			case nsXPTType::T_CHAR   : dp->val.c   = *((char*)    ap);       break;
 			case nsXPTType::T_WCHAR  : dp->val.wc  = *((wchar_t*) ap);       break;
 			default:
-				NS_ASSERTION(0, "bad type");
+				NS_ERROR("bad type");
 				break;
 		}
 	}
 
   result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
 	if(dispatchParams != paramBuffer)
 		delete [] dispatchParams;
@@ -120,16 +120,16 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 
 /* We don't need STUB_ENTRY, since the stubs are defined explicitly in xptc_arm_ceppc.asm */
 
 #define STUB_ENTRY(n) /* */
 
 #define SENTINEL_ENTRY(n)                              \
 nsresult __stdcall nsXPTCStubBase::Sentinel##n()       \
 {                                                      \
-    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
+    NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED;                   \
 }                                                      
 #include "xptcstubsdef.inc"
 
 void xptc_dummy()
 {
 }