Bug 1096341 - require an exception to be set in ToJSValue overload. r=bz

This commit is contained in:
Tom Tromey 2014-11-10 09:06:00 +01:00
parent 1a25033767
commit 905453b959

View File

@ -66,10 +66,10 @@ ToJSValue(JSContext* aCx,
JS::MutableHandle<JS::Value> aValue)
{
MOZ_ASSERT(aArgument.Failed());
ThrowMethodFailedWithDetails(aCx, aArgument, "", "");
if (!JS_GetPendingException(aCx, aValue)) {
return false;
}
DebugOnly<bool> throwResult = ThrowMethodFailedWithDetails(aCx, aArgument, "", "");
MOZ_ASSERT(!throwResult);
DebugOnly<bool> getPendingResult = JS_GetPendingException(aCx, aValue);
MOZ_ASSERT(getPendingResult);
JS_ClearPendingException(aCx);
return true;
}