bug 306382: Make sure that Components.utils.evalInSandbox reports an error if evaluating the JS didn't succeed. r=shaver sr=brendan

This commit is contained in:
mrbkap%gmail.com 2005-08-30 16:28:00 +00:00
parent 77004905b6
commit 1aaaf979d1

View File

@ -2386,6 +2386,8 @@ nsXPCComponents_Utils::EvalInSandbox(const nsAString &source)
if (JS_GetPendingException(sandcx, &exn)) {
JS_SetPendingException(cx, exn);
cc->SetExceptionWasThrown(PR_TRUE);
} else {
rv = NS_ERROR_OUT_OF_MEMORY;
}
} else {
cc->SetReturnValueWasSet(PR_TRUE);
@ -2393,7 +2395,7 @@ nsXPCComponents_Utils::EvalInSandbox(const nsAString &source)
JS_DestroyContextNoGC(sandcx);
JSPRINCIPALS_DROP(cx, jsPrincipals);
return NS_OK;
return rv;
#endif /* !XPCONNECT_STANDALONE */
}