Bug 919209 - Throw re-reports exception onto context. r=bholley

This commit is contained in:
Deian Stefan 2013-10-09 14:43:15 -07:00
parent 1cf06ad9e1
commit 1f5d2eef71

View File

@ -114,7 +114,16 @@ Throw(JSContext* aCx, nsresult aRv, const char* aMessage)
nsresult nr;
if (NS_SUCCEEDED(existingException->GetResult(&nr)) &&
aRv == nr) {
// Just reuse the existing exception.
// Reuse the existing exception.
// Clear pending exception
runtime->SetPendingException(nullptr);
if (!ThrowExceptionObject(aCx, existingException)) {
// If we weren't able to throw an exception we're
// most likely out of memory
JS_ReportOutOfMemory(aCx);
}
return false;
}
}