mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 917915 - Don't leave an exception pending in JS_ReportPendingException. r=jorendorff
This commit is contained in:
parent
d5328610cb
commit
bcd6892931
@ -5946,7 +5946,10 @@ JS_ReportPendingException(JSContext *cx)
|
||||
AssertHeapIsIdle(cx);
|
||||
CHECK_REQUEST(cx);
|
||||
|
||||
return js_ReportUncaughtException(cx);
|
||||
// This can only fail due to oom.
|
||||
bool ok = js_ReportUncaughtException(cx);
|
||||
JS_ASSERT(!cx->isExceptionPending());
|
||||
return ok;
|
||||
}
|
||||
|
||||
struct JSExceptionState {
|
||||
|
@ -1016,13 +1016,10 @@ js_ReportUncaughtException(JSContext *cx)
|
||||
{
|
||||
JSErrorReport *reportp, report;
|
||||
|
||||
if (!JS_IsExceptionPending(cx))
|
||||
if (!cx->isExceptionPending())
|
||||
return true;
|
||||
|
||||
RootedValue exn(cx);
|
||||
if (!JS_GetPendingException(cx, &exn))
|
||||
return false;
|
||||
|
||||
RootedValue exn(cx, cx->getPendingException());
|
||||
AutoValueVector roots(cx);
|
||||
roots.resize(6);
|
||||
|
||||
@ -1126,9 +1123,9 @@ js_ReportUncaughtException(JSContext *cx)
|
||||
/* Pass the exception object. */
|
||||
JS_SetPendingException(cx, exn);
|
||||
js_ReportErrorAgain(cx, bytes, reportp);
|
||||
JS_ClearPendingException(cx);
|
||||
}
|
||||
|
||||
JS_ClearPendingException(cx);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user