diff --git a/js/src/xpconnect/src/xpccomponents.cpp b/js/src/xpconnect/src/xpccomponents.cpp index e1a6e7abd9bb..1d56358e1427 100644 --- a/js/src/xpconnect/src/xpccomponents.cpp +++ b/js/src/xpconnect/src/xpccomponents.cpp @@ -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); }