Backed out changeset 821791826960 (bug 1197893) for Nexus build failures CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 02 Oct 2015 16:17:05 -0700
changeset 301014 a11b056ad49b63fb56298a56f548aaee09b22498
parent 301013 fc03c84dfccbdac04f878dbb54202f5fd627b5dd
child 301015 540c6bc5346e87905d80bcd0c47d554480f81946
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1197893
milestone44.0a1
backs out8217918269609039037035e1f4f80c315664391b
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 821791826960 (bug 1197893) for Nexus build failures CLOSED TREE
dom/archivereader/ArchiveReader.cpp
dom/base/URL.cpp
dom/base/WindowNamedPropertiesHandler.cpp
dom/bindings/ErrorResult.h
dom/cache/Cache.cpp
dom/cache/TypeUtils.cpp
dom/encoding/TextDecoder.cpp
dom/encoding/TextEncoder.cpp
dom/fetch/Fetch.cpp
dom/fetch/FetchUtil.cpp
dom/fetch/InternalHeaders.cpp
dom/fetch/Request.cpp
dom/fetch/Response.cpp
dom/filehandle/FileHandleBase.cpp
dom/indexedDB/IDBCursor.cpp
dom/indexedDB/IDBFactory.cpp
dom/indexedDB/IDBFileHandle.cpp
dom/media/MediaRecorder.cpp
dom/notification/Notification.cpp
dom/svg/SVGSVGElement.cpp
dom/svg/SVGTransform.cpp
dom/svg/SVGViewElement.cpp
dom/workers/ServiceWorkerContainer.cpp
dom/workers/ServiceWorkerRegistration.cpp
--- a/dom/archivereader/ArchiveReader.cpp
+++ b/dom/archivereader/ArchiveReader.cpp
@@ -32,17 +32,17 @@ ArchiveReader::Constructor(const GlobalO
   if (!window) {
     aError.Throw(NS_ERROR_UNEXPECTED);
     return nullptr;
   }
 
   nsAutoCString encoding;
   if (!EncodingUtils::FindEncodingForLabelNoReplacement(aOptions.mEncoding,
                                                         encoding)) {
-    aError.ThrowRangeError<MSG_ENCODING_NOT_SUPPORTED>(&aOptions.mEncoding);
+    aError.ThrowRangeError(MSG_ENCODING_NOT_SUPPORTED, &aOptions.mEncoding);
     return nullptr;
   }
 
   nsRefPtr<ArchiveReader> reader =
     new ArchiveReader(aBlob, window, encoding);
   return reader.forget();
 }
 
--- a/dom/base/URL.cpp
+++ b/dom/base/URL.cpp
@@ -73,33 +73,33 @@ URL::Constructor(const GlobalObject& aGl
 /* static */ already_AddRefed<URL>
 URL::Constructor(nsISupports* aParent, const nsAString& aUrl,
                  const nsAString& aBase, ErrorResult& aRv)
 {
   nsCOMPtr<nsIURI> baseUri;
   nsresult rv = NS_NewURI(getter_AddRefs(baseUri), aBase, nullptr, nullptr,
                           nsContentUtils::GetIOService());
   if (NS_WARN_IF(NS_FAILED(rv))) {
-    aRv.ThrowTypeError<MSG_INVALID_URL>(&aBase);
+    aRv.ThrowTypeError(MSG_INVALID_URL, &aBase);
     return nullptr;
   }
 
   return Constructor(aParent, aUrl, baseUri, aRv);
 }
 
 /* static */
 already_AddRefed<URL>
 URL::Constructor(nsISupports* aParent, const nsAString& aUrl, nsIURI* aBase,
                  ErrorResult& aRv)
 {
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), aUrl, nullptr, aBase,
                           nsContentUtils::GetIOService());
   if (NS_WARN_IF(NS_FAILED(rv))) {
-    aRv.ThrowTypeError<MSG_INVALID_URL>(&aUrl);
+    aRv.ThrowTypeError(MSG_INVALID_URL, &aUrl);
     return nullptr;
   }
 
   nsRefPtr<URL> url = new URL(aParent, uri.forget());
   return url.forget();
 }
 
 void
@@ -225,17 +225,17 @@ URL::SetHref(const nsAString& aHref, Err
     aRv.Throw(rv);
     return;
   }
 
   nsCOMPtr<nsIURI> uri;
   rv = ioService->NewURI(href, nullptr, nullptr, getter_AddRefs(uri));
   if (NS_FAILED(rv)) {
     nsAutoString label(aHref);
-    aRv.ThrowTypeError<MSG_INVALID_URL>(&label);
+    aRv.ThrowTypeError(MSG_INVALID_URL, &label);
     return;
   }
 
   mURI = uri;
   UpdateURLSearchParams();
 }
 
 void
--- a/dom/base/WindowNamedPropertiesHandler.cpp
+++ b/dom/base/WindowNamedPropertiesHandler.cpp
@@ -152,17 +152,17 @@ WindowNamedPropertiesHandler::getOwnProp
 bool
 WindowNamedPropertiesHandler::defineProperty(JSContext* aCx,
                                              JS::Handle<JSObject*> aProxy,
                                              JS::Handle<jsid> aId,
                                              JS::Handle<JSPropertyDescriptor> aDesc,
                                              JS::ObjectOpResult &result) const
 {
   ErrorResult rv;
-  rv.ThrowTypeError<MSG_DEFINEPROPERTY_ON_GSP>();
+  rv.ThrowTypeError(MSG_DEFINEPROPERTY_ON_GSP);
   rv.ReportErrorWithMessage(aCx);
   return false;
 }
 
 bool
 WindowNamedPropertiesHandler::ownPropNames(JSContext* aCx,
                                            JS::Handle<JSObject*> aProxy,
                                            unsigned flags,
--- a/dom/bindings/ErrorResult.h
+++ b/dom/bindings/ErrorResult.h
@@ -32,26 +32,16 @@ namespace dom {
 enum ErrNum {
 #define MSG_DEF(_name, _argc, _exn, _str) \
   _name,
 #include "mozilla/dom/Errors.msg"
 #undef MSG_DEF
   Err_Limit
 };
 
-// Debug-only compile-time table of the number of arguments of each error, for use in static_assert.
-#if defined(DEBUG) && (defined(__clang__) || defined(__GNUC__))
-uint16_t constexpr ErrorFormatNumArgs[] = {
-#define MSG_DEF(_name, _argc, _exn, _str) \
-  _argc,
-#include "mozilla/dom/Errors.msg"
-#undef MSG_DEF
-};
-#endif
-
 uint16_t
 GetErrorArgCount(const ErrNum aErrorNumber);
 
 bool
 ThrowErrorMessage(JSContext* aCx, const ErrNum aErrorNumber, ...);
 
 struct StringArrayAppender
 {
@@ -119,26 +109,26 @@ public:
   // nsresult that you will then return to a caller.  This will
   // SuppressException(), since there will no longer be a way to report it.
   nsresult StealNSResult() {
     nsresult rv = ErrorCode();
     SuppressException();
     return rv;
   }
 
-  template<dom::ErrNum errorNumber, typename... Ts>
-  void ThrowTypeError(Ts... messageArgs)
+  template<typename... Ts>
+  void ThrowTypeError(const dom::ErrNum errorNumber, Ts... messageArgs)
   {
-    ThrowErrorWithMessage<errorNumber>(NS_ERROR_TYPE_ERR, messageArgs...);
+    ThrowErrorWithMessage(errorNumber, NS_ERROR_TYPE_ERR, messageArgs...);
   }
 
-  template<dom::ErrNum errorNumber, typename... Ts>
-  void ThrowRangeError(Ts... messageArgs)
+  template<typename... Ts>
+  void ThrowRangeError(const dom::ErrNum errorNumber, Ts... messageArgs)
   {
-    ThrowErrorWithMessage<errorNumber>(NS_ERROR_RANGE_ERR, messageArgs...);
+    ThrowErrorWithMessage(errorNumber, NS_ERROR_RANGE_ERR, messageArgs...);
   }
 
   void ReportErrorWithMessage(JSContext* cx);
   bool IsErrorWithMessage() const { return ErrorCode() == NS_ERROR_TYPE_ERR || ErrorCode() == NS_ERROR_RANGE_ERR; }
 
   // Facilities for throwing a preexisting JS exception value via this
   // ErrorResult.  The contract is that any code which might end up calling
   // ThrowJSException() must call MightThrowJSException() even if no exception
@@ -216,24 +206,19 @@ private:
   friend struct IPC::ParamTraits<ErrorResult>;
   void SerializeMessage(IPC::Message* aMsg) const;
   bool DeserializeMessage(const IPC::Message* aMsg, void** aIter);
 
   // Helper method that creates a new Message for this ErrorResult,
   // and returns the arguments array from that Message.
   nsTArray<nsString>& CreateErrorMessageHelper(const dom::ErrNum errorNumber, nsresult errorType);
 
-  template<dom::ErrNum errorNumber, typename... Ts>
-  void ThrowErrorWithMessage(nsresult errorType, Ts... messageArgs)
+  template<typename... Ts>
+  void ThrowErrorWithMessage(const dom::ErrNum errorNumber, nsresult errorType, Ts... messageArgs)
   {
-#if defined(DEBUG) && (defined(__clang__) || defined(__GNUC__))
-    static_assert(dom::ErrorFormatNumArgs[errorNumber] == sizeof...(messageArgs),
-                  "Pass in the right number of arguments");
-#endif
-
     if (IsJSException()) {
       // We have rooted our mJSException, and we don't have the info
       // needed to unroot here, so just bail.
       MOZ_ASSERT(false,
                  "Ignoring ThrowErrorWithMessage call because we have a JS exception");
       return;
     }
     nsTArray<nsString>& messageArgsArray = CreateErrorMessageHelper(errorNumber, errorType);
--- a/dom/cache/Cache.cpp
+++ b/dom/cache/Cache.cpp
@@ -42,31 +42,31 @@ IsValidPutRequestURL(const nsAString& aU
 
   TypeUtils::ProcessURL(url, &validScheme, nullptr, nullptr, aRv);
   if (aRv.Failed()) {
     return false;
   }
 
   if (!validScheme) {
     NS_NAMED_LITERAL_STRING(label, "Request");
-    aRv.ThrowTypeError<MSG_INVALID_URL_SCHEME>(&label, &aUrl);
+    aRv.ThrowTypeError(MSG_INVALID_URL_SCHEME, &label, &aUrl);
     return false;
   }
 
   return true;
 }
 
 static bool
 IsValidPutRequestMethod(const Request& aRequest, ErrorResult& aRv)
 {
   nsAutoCString method;
   aRequest.GetMethod(method);
   if (!method.LowerCaseEqualsLiteral("get")) {
     NS_ConvertASCIItoUTF16 label(method);
-    aRv.ThrowTypeError<MSG_INVALID_REQUEST_METHOD>(&label);
+    aRv.ThrowTypeError(MSG_INVALID_REQUEST_METHOD, &label);
     return false;
   }
 
   return true;
 }
 
 static bool
 IsValidPutRequestMethod(const RequestOrUSVString& aRequest, ErrorResult& aRv)
@@ -188,17 +188,17 @@ private:
   ~FetchHandler()
   {
   }
 
   void
   Fail()
   {
     ErrorResult rv;
-    rv.ThrowTypeError<MSG_FETCH_FAILED>();
+    rv.ThrowTypeError(MSG_FETCH_FAILED);
     mPromise->MaybeReject(rv);
   }
 
   nsRefPtr<Feature> mFeature;
   nsRefPtr<Cache> mCache;
   nsTArray<nsRefPtr<Request>> mRequestList;
   nsRefPtr<Promise> mPromise;
 
--- a/dom/cache/TypeUtils.cpp
+++ b/dom/cache/TypeUtils.cpp
@@ -159,17 +159,17 @@ TypeUtils::ToCacheRequest(CacheRequest& 
   if (aRv.Failed()) {
     return;
   }
 
   if (!schemeValid) {
     if (aSchemeAction == TypeErrorOnInvalidScheme) {
       NS_NAMED_LITERAL_STRING(label, "Request");
       NS_ConvertUTF8toUTF16 urlUTF16(url);
-      aRv.ThrowTypeError<MSG_INVALID_URL_SCHEME>(&label, &urlUTF16);
+      aRv.ThrowTypeError(MSG_INVALID_URL_SCHEME, &label, &urlUTF16);
       return;
     }
   }
 
   aIn->GetReferrer(aOut.referrer());
 
   nsRefPtr<InternalHeaders> headers = aIn->Headers();
   MOZ_ASSERT(headers);
@@ -213,34 +213,34 @@ TypeUtils::ToCacheResponseWithoutBody(Ca
     }
   }
 
   aOut.status() = aIn.GetUnfilteredStatus();
   aOut.statusText() = aIn.GetUnfilteredStatusText();
   nsRefPtr<InternalHeaders> headers = aIn.UnfilteredHeaders();
   MOZ_ASSERT(headers);
   if (HasVaryStar(headers)) {
-    aRv.ThrowTypeError<MSG_RESPONSE_HAS_VARY_STAR>();
+    aRv.ThrowTypeError(MSG_RESPONSE_HAS_VARY_STAR);
     return;
   }
   ToHeadersEntryList(aOut.headers(), headers);
   aOut.headersGuard() = headers->Guard();
   aOut.channelInfo() = aIn.GetChannelInfo().AsIPCChannelInfo();
   if (aIn.GetPrincipalInfo()) {
     aOut.principalInfo() = *aIn.GetPrincipalInfo();
   } else {
     aOut.principalInfo() = void_t();
   }
 }
 
 void
 TypeUtils::ToCacheResponse(CacheResponse& aOut, Response& aIn, ErrorResult& aRv)
 {
   if (aIn.BodyUsed()) {
-    aRv.ThrowTypeError<MSG_FETCH_BODY_CONSUMED_ERROR>();
+    aRv.ThrowTypeError(MSG_FETCH_BODY_CONSUMED_ERROR);
     return;
   }
 
   nsRefPtr<InternalResponse> ir = aIn.GetInternalResponse();
   ToCacheResponseWithoutBody(aOut, *ir, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return;
   }
@@ -453,17 +453,17 @@ TypeUtils::CheckAndSetBodyUsed(Request* 
 {
   MOZ_ASSERT(aRequest);
 
   if (aBodyAction == IgnoreBody) {
     return;
   }
 
   if (aRequest->BodyUsed()) {
-    aRv.ThrowTypeError<MSG_FETCH_BODY_CONSUMED_ERROR>();
+    aRv.ThrowTypeError(MSG_FETCH_BODY_CONSUMED_ERROR);
     return;
   }
 
   nsCOMPtr<nsIInputStream> stream;
   aRequest->GetBody(getter_AddRefs(stream));
   if (stream) {
     aRequest->SetBodyUsed();
   }
--- a/dom/encoding/TextDecoder.cpp
+++ b/dom/encoding/TextDecoder.cpp
@@ -21,17 +21,17 @@ TextDecoder::Init(const nsAString& aLabe
 {
   nsAutoCString encoding;
   // Let encoding be the result of getting an encoding from label.
   // If encoding is failure or replacement, throw a RangeError
   // (https://encoding.spec.whatwg.org/#dom-textdecoder).
   if (!EncodingUtils::FindEncodingForLabelNoReplacement(aLabel, encoding)) {
     nsAutoString label(aLabel);
     EncodingUtils::TrimSpaceCharacters(label);
-    aRv.ThrowRangeError<MSG_ENCODING_NOT_SUPPORTED>(&label);
+    aRv.ThrowRangeError(MSG_ENCODING_NOT_SUPPORTED, &label);
     return;
   }
   InitWithEncoding(encoding, aFatal);
 }
 
 void
 TextDecoder::InitWithEncoding(const nsACString& aEncoding, const bool aFatal)
 {
@@ -78,27 +78,27 @@ TextDecoder::Decode(const char* aInput, 
   aOutDecodedString.Append(buf, outLen);
 
   // If the internal streaming flag of the decoder object is not set,
   // then reset the encoding algorithm state to the default values
   if (!aStream) {
     mDecoder->Reset();
     if (rv == NS_OK_UDEC_MOREINPUT) {
       if (mFatal) {
-        aRv.ThrowTypeError<MSG_DOM_DECODING_FAILED>();
+        aRv.ThrowTypeError(MSG_DOM_DECODING_FAILED);
       } else {
         // Need to emit a decode error manually
         // to simulate the EOF handling of the Encoding spec.
         aOutDecodedString.Append(kReplacementChar);
       }
     }
   }
 
   if (NS_FAILED(rv)) {
-    aRv.ThrowTypeError<MSG_DOM_DECODING_FAILED>();
+    aRv.ThrowTypeError(MSG_DOM_DECODING_FAILED);
   }
 }
 
 void
 TextDecoder::Decode(const Optional<ArrayBufferViewOrArrayBuffer>& aBuffer,
                     const TextDecodeOptions& aOptions,
                     nsAString& aOutDecodedString,
                     ErrorResult& aRv)
--- a/dom/encoding/TextEncoder.cpp
+++ b/dom/encoding/TextEncoder.cpp
@@ -16,24 +16,24 @@ TextEncoder::Init(const nsAString& aEnco
 {
   nsAutoString label(aEncoding);
   EncodingUtils::TrimSpaceCharacters(label);
 
   // Let encoding be the result of getting an encoding from label.
   // If encoding is failure, or is none of utf-8, utf-16, and utf-16be,
   // throw a RangeError (https://encoding.spec.whatwg.org/#dom-textencoder).
   if (!EncodingUtils::FindEncodingForLabel(label, mEncoding)) {
-    aRv.ThrowRangeError<MSG_ENCODING_NOT_SUPPORTED>(&label);
+    aRv.ThrowRangeError(MSG_ENCODING_NOT_SUPPORTED, &label);
     return;
   }
 
   if (!mEncoding.EqualsLiteral("UTF-8") &&
       !mEncoding.EqualsLiteral("UTF-16LE") &&
       !mEncoding.EqualsLiteral("UTF-16BE")) {
-    aRv.ThrowRangeError<MSG_DOM_ENCODING_NOT_UTF>();
+    aRv.ThrowRangeError(MSG_DOM_ENCODING_NOT_UTF);
     return;
   }
 
   // Create an encoder object for mEncoding.
   mEncoder = EncodingUtils::EncoderForEncoding(mEncoding);
 }
 
 void
--- a/dom/fetch/Fetch.cpp
+++ b/dom/fetch/Fetch.cpp
@@ -244,17 +244,17 @@ MainThreadFetchResolver::OnResponseAvail
   AssertIsOnMainThread();
 
   if (aResponse->Type() != ResponseType::Error) {
     nsCOMPtr<nsIGlobalObject> go = mPromise->GetParentObject();
     mResponse = new Response(go, aResponse);
     mPromise->MaybeResolve(mResponse);
   } else {
     ErrorResult result;
-    result.ThrowTypeError<MSG_FETCH_FAILED>();
+    result.ThrowTypeError(MSG_FETCH_FAILED);
     mPromise->MaybeReject(result);
   }
 }
 
 MainThreadFetchResolver::~MainThreadFetchResolver()
 {
   NS_ASSERT_OWNINGTHREAD(MainThreadFetchResolver);
 }
@@ -283,17 +283,17 @@ public:
     nsRefPtr<Promise> promise = mResolver->mPromiseProxy->WorkerPromise();
 
     if (mInternalResponse->Type() != ResponseType::Error) {
       nsRefPtr<nsIGlobalObject> global = aWorkerPrivate->GlobalScope();
       nsRefPtr<Response> response = new Response(global, mInternalResponse);
       promise->MaybeResolve(response);
     } else {
       ErrorResult result;
-      result.ThrowTypeError<MSG_FETCH_FAILED>();
+      result.ThrowTypeError(MSG_FETCH_FAILED);
       promise->MaybeReject(result);
     }
     return true;
   }
 };
 
 class WorkerFetchResponseEndRunnable final : public WorkerRunnable
 {
@@ -1471,17 +1471,17 @@ FetchBody<Derived>::ContinueConsumeBody(
 }
 
 template <class Derived>
 already_AddRefed<Promise>
 FetchBody<Derived>::ConsumeBody(ConsumeType aType, ErrorResult& aRv)
 {
   mConsumeType = aType;
   if (BodyUsed()) {
-    aRv.ThrowTypeError<MSG_FETCH_BODY_CONSUMED_ERROR>();
+    aRv.ThrowTypeError(MSG_FETCH_BODY_CONSUMED_ERROR);
     return nullptr;
   }
 
   SetBodyUsed();
 
   mConsumePromise = Promise::Create(DerivedClass()->GetParentObject(), aRv);
   if (aRv.Failed()) {
     return nullptr;
--- a/dom/fetch/FetchUtil.cpp
+++ b/dom/fetch/FetchUtil.cpp
@@ -135,17 +135,17 @@ FetchUtil::ConsumeFormData(nsIGlobalObje
 
   if (isValidFormDataMimeType && aMimeType.Length() > formDataMimeType.Length()) {
     isValidFormDataMimeType = aMimeType[formDataMimeType.Length()] == ';';
   }
 
   if (isValidFormDataMimeType) {
     FormDataParser parser(aMimeType, aStr, aParent);
     if (!parser.Parse()) {
-      aRv.ThrowTypeError<MSG_BAD_FORMDATA>();
+      aRv.ThrowTypeError(MSG_BAD_FORMDATA);
       return nullptr;
     }
 
     nsRefPtr<nsFormData> fd = parser.FormData();
     MOZ_ASSERT(fd);
     return fd.forget();
   }
 
@@ -163,17 +163,17 @@ FetchUtil::ConsumeFormData(nsIGlobalObje
     nsRefPtr<nsFormData> fd = new nsFormData(aParent);
     FillFormIterator iterator(fd);
     DebugOnly<bool> status = params.ForEach(iterator);
     MOZ_ASSERT(status);
 
     return fd.forget();
   }
 
-  aRv.ThrowTypeError<MSG_BAD_FORMDATA>();
+  aRv.ThrowTypeError(MSG_BAD_FORMDATA);
   return nullptr;
 }
 
 // static
 nsresult
 FetchUtil::ConsumeText(uint32_t aInputLength, uint8_t* aInput,
                        nsString& aText)
 {
--- a/dom/fetch/InternalHeaders.cpp
+++ b/dom/fetch/InternalHeaders.cpp
@@ -180,40 +180,40 @@ InternalHeaders::IsSimpleHeader(const ns
 }
 
 //static
 bool
 InternalHeaders::IsInvalidName(const nsACString& aName, ErrorResult& aRv)
 {
   if (!NS_IsValidHTTPToken(aName)) {
     NS_ConvertUTF8toUTF16 label(aName);
-    aRv.ThrowTypeError<MSG_INVALID_HEADER_NAME>(&label);
+    aRv.ThrowTypeError(MSG_INVALID_HEADER_NAME, &label);
     return true;
   }
 
   return false;
 }
 
 // static
 bool
 InternalHeaders::IsInvalidValue(const nsACString& aValue, ErrorResult& aRv)
 {
   if (!NS_IsReasonableHTTPHeaderValue(aValue)) {
     NS_ConvertUTF8toUTF16 label(aValue);
-    aRv.ThrowTypeError<MSG_INVALID_HEADER_VALUE>(&label);
+    aRv.ThrowTypeError(MSG_INVALID_HEADER_VALUE, &label);
     return true;
   }
   return false;
 }
 
 bool
 InternalHeaders::IsImmutable(ErrorResult& aRv) const
 {
   if (mGuard == HeadersGuardEnum::Immutable) {
-    aRv.ThrowTypeError<MSG_HEADERS_IMMUTABLE>();
+    aRv.ThrowTypeError(MSG_HEADERS_IMMUTABLE);
     return true;
   }
   return false;
 }
 
 bool
 InternalHeaders::IsForbiddenRequestHeader(const nsACString& aName) const
 {
@@ -254,17 +254,17 @@ InternalHeaders::Fill(const InternalHead
 }
 
 void
 InternalHeaders::Fill(const Sequence<Sequence<nsCString>>& aInit, ErrorResult& aRv)
 {
   for (uint32_t i = 0; i < aInit.Length() && !aRv.Failed(); ++i) {
     const Sequence<nsCString>& tuple = aInit[i];
     if (tuple.Length() != 2) {
-      aRv.ThrowTypeError<MSG_INVALID_HEADER_SEQUENCE>();
+      aRv.ThrowTypeError(MSG_INVALID_HEADER_SEQUENCE);
       return;
     }
     Append(tuple[0], tuple[1], aRv);
   }
 }
 
 void
 InternalHeaders::Fill(const MozMap<nsCString>& aInit, ErrorResult& aRv)
--- a/dom/fetch/Request.cpp
+++ b/dom/fetch/Request.cpp
@@ -78,26 +78,26 @@ GetRequestURLFromDocument(nsIDocument* a
 {
   MOZ_ASSERT(aDocument);
   MOZ_ASSERT(NS_IsMainThread());
 
   nsCOMPtr<nsIURI> baseURI = aDocument->GetBaseURI();
   nsCOMPtr<nsIURI> resolvedURI;
   aRv = NS_NewURI(getter_AddRefs(resolvedURI), aInput, nullptr, baseURI);
   if (NS_WARN_IF(aRv.Failed())) {
-    aRv.ThrowTypeError<MSG_INVALID_URL>(&aInput);
+    aRv.ThrowTypeError(MSG_INVALID_URL, &aInput);
     return;
   }
 
   // This fails with URIs with weird protocols, even when they are valid,
   // so we ignore the failure
   nsAutoCString credentials;
   unused << resolvedURI->GetUserPass(credentials);
   if (!credentials.IsEmpty()) {
-    aRv.ThrowTypeError<MSG_URL_HAS_CREDENTIALS>(&aInput);
+    aRv.ThrowTypeError(MSG_URL_HAS_CREDENTIALS, &aInput);
     return;
   }
 
   nsCOMPtr<nsIURI> resolvedURIClone;
   // We use CloneIgnoringRef to strip away the fragment even if the original URI
   // is immutable.
   aRv = resolvedURI->CloneIgnoringRef(getter_AddRefs(resolvedURIClone));
   if (NS_WARN_IF(aRv.Failed())) {
@@ -117,26 +117,26 @@ void
 GetRequestURLFromChrome(const nsAString& aInput, nsAString& aRequestURL,
                         ErrorResult& aRv)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsCOMPtr<nsIURI> uri;
   aRv = NS_NewURI(getter_AddRefs(uri), aInput, nullptr, nullptr);
   if (NS_WARN_IF(aRv.Failed())) {
-    aRv.ThrowTypeError<MSG_INVALID_URL>(&aInput);
+    aRv.ThrowTypeError(MSG_INVALID_URL, &aInput);
     return;
   }
 
   // This fails with URIs with weird protocols, even when they are valid,
   // so we ignore the failure
   nsAutoCString credentials;
   unused << uri->GetUserPass(credentials);
   if (!credentials.IsEmpty()) {
-    aRv.ThrowTypeError<MSG_URL_HAS_CREDENTIALS>(&aInput);
+    aRv.ThrowTypeError(MSG_URL_HAS_CREDENTIALS, &aInput);
     return;
   }
 
   nsCOMPtr<nsIURI> uriClone;
   // We use CloneIgnoringRef to strip away the fragment even if the original URI
   // is immutable.
   aRv = uri->CloneIgnoringRef(getter_AddRefs(uriClone));
   if (NS_WARN_IF(aRv.Failed())) {
@@ -159,34 +159,34 @@ GetRequestURLFromWorker(const GlobalObje
   workers::WorkerPrivate* worker = workers::GetCurrentThreadWorkerPrivate();
   MOZ_ASSERT(worker);
   worker->AssertIsOnWorkerThread();
 
   NS_ConvertUTF8toUTF16 baseURL(worker->GetLocationInfo().mHref);
   nsRefPtr<workers::URL> url =
     workers::URL::Constructor(aGlobal, aInput, baseURL, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
-    aRv.ThrowTypeError<MSG_INVALID_URL>(&aInput);
+    aRv.ThrowTypeError(MSG_INVALID_URL, &aInput);
     return;
   }
 
   nsString username;
   url->GetUsername(username, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return;
   }
 
   nsString password;
   url->GetPassword(password, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return;
   }
 
   if (!username.IsEmpty() || !password.IsEmpty()) {
-    aRv.ThrowTypeError<MSG_URL_HAS_CREDENTIALS>(&aInput);
+    aRv.ThrowTypeError(MSG_URL_HAS_CREDENTIALS, &aInput);
     return;
   }
 
   url->SetHash(EmptyString(), aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return;
   }
 
@@ -209,17 +209,17 @@ Request::Constructor(const GlobalObject&
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
 
   if (aInput.IsRequest()) {
     nsRefPtr<Request> inputReq = &aInput.GetAsRequest();
     nsCOMPtr<nsIInputStream> body;
     inputReq->GetBody(getter_AddRefs(body));
     if (body) {
       if (inputReq->BodyUsed()) {
-        aRv.ThrowTypeError<MSG_FETCH_BODY_CONSUMED_ERROR>();
+        aRv.ThrowTypeError(MSG_FETCH_BODY_CONSUMED_ERROR);
         return nullptr;
       }
       temporaryBody = body;
     }
 
     request = inputReq->GetInternalRequest();
   } else {
     request = new InternalRequest();
@@ -262,17 +262,17 @@ Request::Constructor(const GlobalObject&
 
   // CORS-with-forced-preflight is not publicly exposed and should not be
   // considered a valid value.
   if (aInit.mMode.WasPassed() &&
       aInit.mMode.Value() == RequestMode::Cors_with_forced_preflight) {
     NS_NAMED_LITERAL_STRING(sourceDescription, "'mode' member of RequestInit");
     NS_NAMED_LITERAL_STRING(value, "cors-with-forced-preflight");
     NS_NAMED_LITERAL_STRING(type, "RequestMode");
-    aRv.ThrowTypeError<MSG_INVALID_ENUM_VALUE>(&sourceDescription, &value, &type);
+    aRv.ThrowTypeError(MSG_INVALID_ENUM_VALUE, &sourceDescription, &value, &type);
     return nullptr;
   }
   RequestMode mode = aInit.mMode.WasPassed() ? aInit.mMode.Value() : fallbackMode;
   RequestCredentials credentials =
     aInit.mCredentials.WasPassed() ? aInit.mCredentials.Value()
                                    : fallbackCredentials;
 
   if (mode != RequestMode::EndGuard_) {
@@ -302,17 +302,17 @@ Request::Constructor(const GlobalObject&
 
     // Step 14.1. Disallow forbidden methods, and anything that is not a HTTP
     // token, since HTTP states that Method may be any of the defined values or
     // a token (extension method).
     nsAutoCString outMethod;
     nsresult rv = FetchUtil::GetValidRequestMethod(method, outMethod);
     if (NS_FAILED(rv)) {
       NS_ConvertUTF8toUTF16 label(method);
-      aRv.ThrowTypeError<MSG_INVALID_REQUEST_METHOD>(&label);
+      aRv.ThrowTypeError(MSG_INVALID_REQUEST_METHOD, &label);
       return nullptr;
     }
 
     // Step 14.2
     request->ClearCreatedByFetchEvent();
     request->SetMethod(outMethod);
   }
 
@@ -336,17 +336,17 @@ Request::Constructor(const GlobalObject&
   requestHeaders->SetGuard(HeadersGuardEnum::Request, aRv);
   MOZ_ASSERT(!aRv.Failed());
 
   if (request->Mode() == RequestMode::No_cors) {
     if (!request->HasSimpleMethod()) {
       nsAutoCString method;
       request->GetMethod(method);
       NS_ConvertUTF8toUTF16 label(method);
-      aRv.ThrowTypeError<MSG_INVALID_REQUEST_METHOD>(&label);
+      aRv.ThrowTypeError(MSG_INVALID_REQUEST_METHOD, &label);
       return nullptr;
     }
 
     requestHeaders->SetGuard(HeadersGuardEnum::Request_no_cors, aRv);
     if (aRv.Failed()) {
       return nullptr;
     }
   }
@@ -357,17 +357,17 @@ Request::Constructor(const GlobalObject&
   }
 
   if (aInit.mBody.WasPassed() || temporaryBody) {
     // HEAD and GET are not allowed to have a body.
     nsAutoCString method;
     request->GetMethod(method);
     // method is guaranteed to be uppercase due to step 14.2 above.
     if (method.EqualsLiteral("HEAD") || method.EqualsLiteral("GET")) {
-      aRv.ThrowTypeError<MSG_NO_BODY_ALLOWED_FOR_GET_AND_HEAD>();
+      aRv.ThrowTypeError(MSG_NO_BODY_ALLOWED_FOR_GET_AND_HEAD);
       return nullptr;
     }
   }
 
   if (aInit.mBody.WasPassed()) {
     const OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& bodyInit = aInit.mBody.Value();
     nsCOMPtr<nsIInputStream> stream;
     nsAutoCString contentType;
@@ -407,17 +407,17 @@ Request::Constructor(const GlobalObject&
   }
   return domRequest.forget();
 }
 
 already_AddRefed<Request>
 Request::Clone(ErrorResult& aRv) const
 {
   if (BodyUsed()) {
-    aRv.ThrowTypeError<MSG_FETCH_BODY_CONSUMED_ERROR>();
+    aRv.ThrowTypeError(MSG_FETCH_BODY_CONSUMED_ERROR);
     return nullptr;
   }
 
   nsRefPtr<InternalRequest> ir = mRequest->Clone();
   if (!ir) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
--- a/dom/fetch/Response.cpp
+++ b/dom/fetch/Response.cpp
@@ -95,17 +95,17 @@ Response::Redirect(const GlobalObject& a
     url->Stringify(parsedURL, aRv);
   }
 
   if (aRv.Failed()) {
     return nullptr;
   }
 
   if (aStatus != 301 && aStatus != 302 && aStatus != 303 && aStatus != 307 && aStatus != 308) {
-    aRv.ThrowRangeError<MSG_INVALID_REDIRECT_STATUSCODE_ERROR>();
+    aRv.ThrowRangeError(MSG_INVALID_REDIRECT_STATUSCODE_ERROR);
     return nullptr;
   }
 
   Optional<ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams> body;
   ResponseInit init;
   init.mStatus = aStatus;
   nsRefPtr<Response> r = Response::Constructor(aGlobal, body, init, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
@@ -126,34 +126,34 @@ Response::Redirect(const GlobalObject& a
 /*static*/ already_AddRefed<Response>
 Response::Constructor(const GlobalObject& aGlobal,
                       const Optional<ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams>& aBody,
                       const ResponseInit& aInit, ErrorResult& aRv)
 {
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
 
   if (aInit.mStatus < 200 || aInit.mStatus > 599) {
-    aRv.ThrowRangeError<MSG_INVALID_RESPONSE_STATUSCODE_ERROR>();
+    aRv.ThrowRangeError(MSG_INVALID_RESPONSE_STATUSCODE_ERROR);
     return nullptr;
   }
 
   nsCString statusText;
   if (aInit.mStatusText.WasPassed()) {
     statusText = aInit.mStatusText.Value();
     nsACString::const_iterator start, end;
     statusText.BeginReading(start);
     statusText.EndReading(end);
     if (FindCharInReadable('\r', start, end)) {
-      aRv.ThrowTypeError<MSG_RESPONSE_INVALID_STATUSTEXT_ERROR>();
+      aRv.ThrowTypeError(MSG_RESPONSE_INVALID_STATUSTEXT_ERROR);
       return nullptr;
     }
     // Reset iterator since FindCharInReadable advances it.
     statusText.BeginReading(start);
     if (FindCharInReadable('\n', start, end)) {
-      aRv.ThrowTypeError<MSG_RESPONSE_INVALID_STATUSTEXT_ERROR>();
+      aRv.ThrowTypeError(MSG_RESPONSE_INVALID_STATUSTEXT_ERROR);
       return nullptr;
     }
   } else {
     // Since we don't support default values for ByteString.
     statusText = NS_LITERAL_CSTRING("OK");
   }
 
   nsRefPtr<InternalResponse> internalResponse =
@@ -194,17 +194,17 @@ Response::Constructor(const GlobalObject
     internalResponse->Headers()->Fill(*headers->GetInternalHeaders(), aRv);
     if (NS_WARN_IF(aRv.Failed())) {
       return nullptr;
     }
   }
 
   if (aBody.WasPassed()) {
     if (aInit.mStatus == 204 || aInit.mStatus == 205 || aInit.mStatus == 304) {
-      aRv.ThrowTypeError<MSG_RESPONSE_NULL_STATUS_WITH_BODY>();
+      aRv.ThrowTypeError(MSG_RESPONSE_NULL_STATUS_WITH_BODY);
       return nullptr;
     }
 
     nsCOMPtr<nsIInputStream> bodyStream;
     nsCString contentType;
     aRv = ExtractByteStreamFromBody(aBody.Value(), getter_AddRefs(bodyStream), contentType);
     internalResponse->SetBody(bodyStream);
 
@@ -221,17 +221,17 @@ Response::Constructor(const GlobalObject
   r->SetMimeType();
   return r.forget();
 }
 
 already_AddRefed<Response>
 Response::Clone(ErrorResult& aRv) const
 {
   if (BodyUsed()) {
-    aRv.ThrowTypeError<MSG_FETCH_BODY_CONSUMED_ERROR>();
+    aRv.ThrowTypeError(MSG_FETCH_BODY_CONSUMED_ERROR);
     return nullptr;
   }
 
   nsRefPtr<InternalResponse> ir = mInternalResponse->Clone();
   nsRefPtr<Response> response = new Response(mOwner, ir);
   return response.forget();
 }
 
--- a/dom/filehandle/FileHandleBase.cpp
+++ b/dom/filehandle/FileHandleBase.cpp
@@ -354,17 +354,17 @@ FileHandleBase::CheckStateAndArgumentsFo
   // Additional state checking for read
   if (mLocation == UINT64_MAX) {
     aRv.Throw(NS_ERROR_DOM_FILEHANDLE_NOT_ALLOWED_ERR);
     return false;
   }
 
   // Argument checking for read
   if (!aSize) {
-    aRv.ThrowTypeError<MSG_INVALID_READ_SIZE>();
+    aRv.ThrowTypeError(MSG_INVALID_READ_SIZE);
     return false;
   }
 
   return true;
 }
 
 bool
 FileHandleBase::CheckStateForWrite(ErrorResult& aRv)
--- a/dom/indexedDB/IDBCursor.cpp
+++ b/dom/indexedDB/IDBCursor.cpp
@@ -515,17 +515,17 @@ IDBCursor::Continue(JSContext* aCx,
 }
 
 void
 IDBCursor::Advance(uint32_t aCount, ErrorResult &aRv)
 {
   AssertIsOnOwningThread();
 
   if (!aCount) {
-    aRv.ThrowTypeError<MSG_INVALID_ADVANCE_COUNT>();
+    aRv.ThrowTypeError(MSG_INVALID_ADVANCE_COUNT);
     return;
   }
 
   if (!mTransaction->IsOpen()) {
     aRv.Throw(NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR);
     return;
   }
 
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -652,17 +652,17 @@ IDBFactory::OpenInternal(nsIPrincipal* a
     }
   } else {
     principalInfo = *mPrincipalInfo;
   }
 
   uint64_t version = 0;
   if (!aDeleting && aVersion.WasPassed()) {
     if (aVersion.Value() < 1) {
-      aRv.ThrowTypeError<MSG_INVALID_VERSION>();
+      aRv.ThrowTypeError(MSG_INVALID_VERSION);
       return nullptr;
     }
     version = aVersion.Value();
   }
 
   // Nothing can be done here if we have previously failed to create a
   // background actor.
   if (mBackgroundActorFailed) {
--- a/dom/indexedDB/IDBFileHandle.cpp
+++ b/dom/indexedDB/IDBFileHandle.cpp
@@ -70,17 +70,17 @@ IDBFileHandle::GetMetadata(const IDBFile
 
   // Common state checking
   if (!CheckState(aRv)) {
     return nullptr;
   }
 
   // Argument checking for get metadata.
   if (!aParameters.mSize && !aParameters.mLastModified) {
-    aRv.ThrowTypeError<MSG_METADATA_NOT_CONFIGURED>();
+    aRv.ThrowTypeError(MSG_METADATA_NOT_CONFIGURED);
     return nullptr;
   }
 
  // Do nothing if the window is closed
   if (!CheckWindow()) {
     return nullptr;
   }
 
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -983,17 +983,17 @@ MediaRecorder::Constructor(const GlobalO
                            const MediaRecorderOptions& aInitDict,
                            ErrorResult& aRv)
 {
   // Allow recording from audio node only when pref is on.
   if (!Preferences::GetBool("media.recorder.audio_node.enabled", false)) {
     // Pretending that this constructor is not defined.
     NS_NAMED_LITERAL_STRING(argStr, "Argument 1 of MediaRecorder.constructor");
     NS_NAMED_LITERAL_STRING(typeStr, "MediaStream");
-    aRv.ThrowTypeError<MSG_DOES_NOT_IMPLEMENT_INTERFACE>(&argStr, &typeStr);
+    aRv.ThrowTypeError(MSG_DOES_NOT_IMPLEMENT_INTERFACE, &argStr, &typeStr);
     return nullptr;
   }
 
   nsCOMPtr<nsPIDOMWindow> ownerWindow = do_QueryInterface(aGlobal.GetAsSupports());
   if (!ownerWindow) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -810,17 +810,17 @@ Notification::Constructor(const GlobalOb
                           const nsAString& aTitle,
                           const NotificationOptions& aOptions,
                           ErrorResult& aRv)
 {
   // FIXME(nsm): If the sticky flag is set, throw an error.
   ServiceWorkerGlobalScope* scope = nullptr;
   UNWRAP_WORKER_OBJECT(ServiceWorkerGlobalScope, aGlobal.Get(), scope);
   if (scope) {
-    aRv.ThrowTypeError<MSG_NOTIFICATION_NO_CONSTRUCTOR_IN_SERVICEWORKER>();
+    aRv.ThrowTypeError(MSG_NOTIFICATION_NO_CONSTRUCTOR_IN_SERVICEWORKER);
     return nullptr;
   }
 
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
   nsRefPtr<Notification> notification =
     CreateAndShow(global, aTitle, aOptions, EmptyString(), aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
@@ -2315,17 +2315,17 @@ Notification::ShowPersistentNotification
     if (!loadChecker->Dispatch(worker->GetJSContext())) {
       aRv.Throw(NS_ERROR_DOM_ABORT_ERR);
       return nullptr;
     }
 
     if (NS_WARN_IF(NS_FAILED(loadChecker->Result()))) {
       if (loadChecker->Result() == NS_ERROR_NOT_AVAILABLE) {
         nsAutoString scope(aScope);
-        aRv.ThrowTypeError<MSG_NO_ACTIVE_WORKER>(&scope);
+        aRv.ThrowTypeError(MSG_NO_ACTIVE_WORKER, &scope);
       } else {
         aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
       }
       return nullptr;
     }
   }
 
 
@@ -2336,17 +2336,17 @@ Notification::ShowPersistentNotification
 
   // We check permission here rather than pass the Promise to NotificationTask
   // which leads to uglier code.
   NotificationPermission permission = GetPermission(aGlobal, aRv);
 
   // "If permission for notification’s origin is not "granted", reject promise with a TypeError exception, and terminate these substeps."
   if (NS_WARN_IF(aRv.Failed()) || permission == NotificationPermission::Denied) {
     ErrorResult result;
-    result.ThrowTypeError<MSG_NOTIFICATION_PERMISSION_DENIED>();
+    result.ThrowTypeError(MSG_NOTIFICATION_PERMISSION_DENIED);
     p->MaybeReject(result);
     return p.forget();
   }
 
   // "Otherwise, resolve promise with undefined."
   // The Notification may still not be shown due to other errors, but the spec
   // is not concerned with those.
   p->MaybeResolve(JS::UndefinedHandleValue);
--- a/dom/svg/SVGSVGElement.cpp
+++ b/dom/svg/SVGSVGElement.cpp
@@ -465,17 +465,17 @@ void
 SVGSVGElement::SetZoomAndPan(uint16_t aZoomAndPan, ErrorResult& rv)
 {
   if (aZoomAndPan == SVG_ZOOMANDPAN_DISABLE ||
       aZoomAndPan == SVG_ZOOMANDPAN_MAGNIFY) {
     mEnumAttributes[ZOOMANDPAN].SetBaseValue(aZoomAndPan, this);
     return;
   }
 
-  rv.ThrowRangeError<MSG_INVALID_ZOOMANDPAN_VALUE_ERROR>();
+  rv.ThrowRangeError(MSG_INVALID_ZOOMANDPAN_VALUE_ERROR);
 }
 
 //----------------------------------------------------------------------
 // helper methods for implementing SVGZoomEvent:
 
 void
 SVGSVGElement::SetCurrentScaleTranslate(float s, float x, float y)
 {
--- a/dom/svg/SVGTransform.cpp
+++ b/dom/svg/SVGTransform.cpp
@@ -255,17 +255,17 @@ SVGTransform::SetSkewX(float angle, Erro
   }
 
   if (Transform().Type() == SVG_TRANSFORM_SKEWX &&
       Transform().Angle() == angle) {
     return;
   }
 
   if (!IsFinite(tan(angle * kRadPerDegree))) {
-    rv.ThrowRangeError<MSG_INVALID_TRANSFORM_ANGLE_ERROR>();
+    rv.ThrowRangeError(MSG_INVALID_TRANSFORM_ANGLE_ERROR);
     return;
   }
 
   AutoChangeTransformNotifier notifier(this);
   DebugOnly<nsresult> result = Transform().SetSkewX(angle);
   MOZ_ASSERT(NS_SUCCEEDED(result), "SetSkewX unexpectedly failed");
 }
 
@@ -278,17 +278,17 @@ SVGTransform::SetSkewY(float angle, Erro
   }
 
   if (Transform().Type() == SVG_TRANSFORM_SKEWY &&
       Transform().Angle() == angle) {
     return;
   }
 
   if (!IsFinite(tan(angle * kRadPerDegree))) {
-    rv.ThrowRangeError<MSG_INVALID_TRANSFORM_ANGLE_ERROR>();
+    rv.ThrowRangeError(MSG_INVALID_TRANSFORM_ANGLE_ERROR);
     return;
   }
 
   AutoChangeTransformNotifier notifier(this);
   DebugOnly<nsresult> result = Transform().SetSkewY(angle);
   MOZ_ASSERT(NS_SUCCEEDED(result), "SetSkewY unexpectedly failed");
 }
 
--- a/dom/svg/SVGViewElement.cpp
+++ b/dom/svg/SVGViewElement.cpp
@@ -55,17 +55,17 @@ void
 SVGViewElement::SetZoomAndPan(uint16_t aZoomAndPan, ErrorResult& rv)
 {
   if (aZoomAndPan == SVG_ZOOMANDPAN_DISABLE ||
       aZoomAndPan == SVG_ZOOMANDPAN_MAGNIFY) {
     mEnumAttributes[ZOOMANDPAN].SetBaseValue(aZoomAndPan, this);
     return;
   }
 
-  rv.ThrowRangeError<MSG_INVALID_ZOOMANDPAN_VALUE_ERROR>();
+  rv.ThrowRangeError(MSG_INVALID_ZOOMANDPAN_VALUE_ERROR);
 }
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedRect>
 SVGViewElement::ViewBox()
 {
   return mViewBox.ToSVGAnimatedRect(this);
--- a/dom/workers/ServiceWorkerContainer.cpp
+++ b/dom/workers/ServiceWorkerContainer.cpp
@@ -163,17 +163,17 @@ ServiceWorkerContainer::Register(const n
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return nullptr;
   }
 
   nsresult rv;
   nsCOMPtr<nsIURI> scriptURI;
   rv = NS_NewURI(getter_AddRefs(scriptURI), aScriptURL, nullptr, baseURI);
   if (NS_WARN_IF(NS_FAILED(rv))) {
-    aRv.ThrowTypeError<MSG_INVALID_URL>(&aScriptURL);
+    aRv.ThrowTypeError(MSG_INVALID_URL, &aScriptURL);
     return nullptr;
   }
 
   aRv = CheckForSlashEscapedCharsInPath(scriptURI);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
@@ -185,28 +185,28 @@ ServiceWorkerContainer::Register(const n
   if (!aOptions.mScope.WasPassed()) {
     NS_NAMED_LITERAL_STRING(defaultScope, "./");
     rv = NS_NewURI(getter_AddRefs(scopeURI), defaultScope,
                    nullptr, scriptURI);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       nsAutoCString spec;
       scriptURI->GetSpec(spec);
       NS_ConvertUTF8toUTF16 wSpec(spec);
-      aRv.ThrowTypeError<MSG_INVALID_SCOPE>(&defaultScope, &wSpec);
+      aRv.ThrowTypeError(MSG_INVALID_SCOPE, &defaultScope, &wSpec);
       return nullptr;
     }
   } else {
     // Step 5. Parse against entry settings object's base URL.
     rv = NS_NewURI(getter_AddRefs(scopeURI), aOptions.mScope.Value(),
                    nullptr, baseURI);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       nsAutoCString spec;
       baseURI->GetSpec(spec);
       NS_ConvertUTF8toUTF16 wSpec(spec);
-      aRv.ThrowTypeError<MSG_INVALID_SCOPE>(&aOptions.mScope.Value(), &wSpec);
+      aRv.ThrowTypeError(MSG_INVALID_SCOPE, &aOptions.mScope.Value(), &wSpec);
       return nullptr;
     }
 
     aRv = CheckForSlashEscapedCharsInPath(scopeURI);
     if (NS_WARN_IF(aRv.Failed())) {
       return nullptr;
     }
   }
--- a/dom/workers/ServiceWorkerRegistration.cpp
+++ b/dom/workers/ServiceWorkerRegistration.cpp
@@ -699,17 +699,17 @@ ServiceWorkerRegistrationMainThread::Sho
   nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
   if (NS_WARN_IF(!doc)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsRefPtr<workers::ServiceWorker> worker = GetActive();
   if (!worker) {
-    aRv.ThrowTypeError<MSG_NO_ACTIVE_WORKER>(&mScope);
+    aRv.ThrowTypeError(MSG_NO_ACTIVE_WORKER, &mScope);
     return nullptr;
   }
 
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(window);
   nsRefPtr<Promise> p =
     Notification::ShowPersistentNotification(global,
                                              mScope, aTitle, aOptions, aRv);
   if (NS_WARN_IF(aRv.Failed())) {