mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-23 13:04:28 +00:00
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:
parent
77004905b6
commit
1aaaf979d1
@ -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 */
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user