From f4f48c7990bcb6efdb37488065ce39eec3bc07df Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 10 Nov 2014 09:06:00 +0100 Subject: [PATCH] Bug 1096341 - require an exception to be set in ToJSValue overload. r=bz --- dom/bindings/ToJSValue.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dom/bindings/ToJSValue.cpp b/dom/bindings/ToJSValue.cpp index 4fea13b51692..cbefc0218f09 100644 --- a/dom/bindings/ToJSValue.cpp +++ b/dom/bindings/ToJSValue.cpp @@ -66,10 +66,10 @@ ToJSValue(JSContext* aCx, JS::MutableHandle aValue) { MOZ_ASSERT(aArgument.Failed()); - ThrowMethodFailedWithDetails(aCx, aArgument, "", ""); - if (!JS_GetPendingException(aCx, aValue)) { - return false; - } + DebugOnly throwResult = ThrowMethodFailedWithDetails(aCx, aArgument, "", ""); + MOZ_ASSERT(!throwResult); + DebugOnly getPendingResult = JS_GetPendingException(aCx, aValue); + MOZ_ASSERT(getPendingResult); JS_ClearPendingException(aCx); return true; }