зеркало из https://github.com/mozilla/gecko-dev.git
Bug 630772. Fix compartment mismatch in evalInSandbox(). r=jst@mozilla.com. a=blocker
This commit is contained in:
Родитель
c28587e2c5
Коммит
430fc45b00
|
@ -3703,13 +3703,12 @@ xpc_EvalInSandbox(JSContext *cx, JSObject *sandbox, const nsAString& source,
|
|||
// exception into a string.
|
||||
str = JS_ValueToString(sandcx->GetJSContext(), exn);
|
||||
|
||||
JSAutoRequest req(cx);
|
||||
if (str) {
|
||||
// We converted the exception to a string. Use that
|
||||
// as the value exception.
|
||||
exn = STRING_TO_JSVAL(str);
|
||||
if (JS_WrapValue(cx, &exn)) {
|
||||
JS_SetPendingException(cx, STRING_TO_JSVAL(str));
|
||||
JS_SetPendingException(cx, exn);
|
||||
} else {
|
||||
JS_ClearPendingException(cx);
|
||||
rv = NS_ERROR_FAILURE;
|
||||
|
@ -3719,8 +3718,6 @@ xpc_EvalInSandbox(JSContext *cx, JSObject *sandbox, const nsAString& source,
|
|||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
} else {
|
||||
JSAutoRequest req(cx);
|
||||
|
||||
if (JS_WrapValue(cx, &exn)) {
|
||||
JS_SetPendingException(cx, exn);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче