mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 783532 - Remove DOMError::CreateForDOMExceptionCode. r=sicking
This commit is contained in:
parent
0035caf975
commit
bedd012505
@ -6,11 +6,9 @@
|
||||
|
||||
#include "DOMError.h"
|
||||
|
||||
#include "mozilla/Util.h"
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "nsDOMException.h"
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
using mozilla::dom::DOMError;
|
||||
|
||||
namespace {
|
||||
@ -36,47 +34,6 @@ DOMError::CreateForNSResult(nsresult aRv)
|
||||
return CreateWithName(NS_ConvertASCIItoUTF16(name));
|
||||
}
|
||||
|
||||
// static
|
||||
already_AddRefed<nsIDOMDOMError>
|
||||
DOMError::CreateForDOMExceptionCode(PRUint16 aDOMExceptionCode)
|
||||
{
|
||||
// All of these codes (and yes, some are skipped) come from the spec.
|
||||
static const NameMap kNames[] = {
|
||||
{ 1, "IndexSizeError" },
|
||||
{ 3, "HierarchyRequestError" },
|
||||
{ 4, "WrongDocumentError" },
|
||||
{ 5, "InvalidCharacterError" },
|
||||
{ 7, "NoModificationAllowedError" },
|
||||
{ 8, "NotFoundError" },
|
||||
{ 9, "NotSupportedError" },
|
||||
{ 11, "InvalidStateError" },
|
||||
{ 12, "SyntaxError" },
|
||||
{ 13, "InvalidModificationError" },
|
||||
{ 14, "NamespaceError" },
|
||||
{ 15, "InvalidAccessError" },
|
||||
{ 17, "TypeMismatchError" },
|
||||
{ 18, "SecurityError" },
|
||||
{ 19, "NetworkError" },
|
||||
{ 20, "AbortError" },
|
||||
{ 21, "URLMismatchError" },
|
||||
{ 22, "QuotaExceededError" },
|
||||
{ 23, "TimeoutError" },
|
||||
{ 24, "InvalidNodeTypeError" },
|
||||
{ 25, "DataCloneError" }
|
||||
};
|
||||
|
||||
for (size_t index = 0; index < ArrayLength(kNames); index++) {
|
||||
if (kNames[index].code == aDOMExceptionCode) {
|
||||
nsString name;
|
||||
name.AssignASCII(kNames[index].name);
|
||||
return CreateWithName(name);
|
||||
}
|
||||
}
|
||||
|
||||
NS_NOTREACHED("Unknown DOMException code!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(DOMError)
|
||||
NS_IMPL_RELEASE(DOMError)
|
||||
|
||||
|
@ -26,9 +26,6 @@ public:
|
||||
static already_AddRefed<nsIDOMDOMError>
|
||||
CreateForNSResult(nsresult rv);
|
||||
|
||||
static already_AddRefed<nsIDOMDOMError>
|
||||
CreateForDOMExceptionCode(PRUint16 aDOMExceptionCode);
|
||||
|
||||
static already_AddRefed<nsIDOMDOMError>
|
||||
CreateWithName(const nsAString& aName)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user