From 95468c06a9536989328fe7976627baac79787729 Mon Sep 17 00:00:00 2001 From: "peterv%propagandism.org" Date: Sat, 7 Jan 2006 17:35:24 +0000 Subject: [PATCH] Fix for bug 318894 (XPath exceptions are reported as unknown). r/sr=jst. --- dom/src/base/nsDOMException.h | 1 + dom/src/base/nsDOMScriptObjectFactory.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/dom/src/base/nsDOMException.h b/dom/src/base/nsDOMException.h index 6f7373378553..98bea54e3b02 100644 --- a/dom/src/base/nsDOMException.h +++ b/dom/src/base/nsDOMException.h @@ -72,3 +72,4 @@ DECL_INTERNAL_DOM_EXCEPTION(RangeException) #ifdef MOZ_SVG DECL_INTERNAL_DOM_EXCEPTION(SVGException) #endif +DECL_INTERNAL_DOM_EXCEPTION(XPathException) diff --git a/dom/src/base/nsDOMScriptObjectFactory.cpp b/dom/src/base/nsDOMScriptObjectFactory.cpp index 9177299fb30b..a9d06a36c935 100644 --- a/dom/src/base/nsDOMScriptObjectFactory.cpp +++ b/dom/src/base/nsDOMScriptObjectFactory.cpp @@ -81,6 +81,7 @@ nsDOMScriptObjectFactory::nsDOMScriptObjectFactory() #ifdef MOZ_SVG xs->RegisterExceptionProvider(this, NS_ERROR_MODULE_SVG); #endif + xs->RegisterExceptionProvider(this, NS_ERROR_MODULE_DOM_XPATH); } } @@ -191,6 +192,7 @@ nsDOMScriptObjectFactory::Observe(nsISupports *aSubject, #ifdef MOZ_SVG xs->UnregisterExceptionProvider(this, NS_ERROR_MODULE_SVG); #endif + xs->UnregisterExceptionProvider(this, NS_ERROR_MODULE_DOM_XPATH); } } @@ -210,6 +212,8 @@ nsDOMScriptObjectFactory::GetException(nsresult result, case NS_ERROR_MODULE_SVG: return NS_NewSVGException(result, aDefaultException, _retval); #endif + case NS_ERROR_MODULE_DOM_XPATH: + return NS_NewXPathException(result, aDefaultException, _retval); default: return NS_NewDOMException(result, aDefaultException, _retval); }