mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
Bug 473437 - DumpJSStack() can set a pending exception in cx. r+sr=jst
This commit is contained in:
parent
e1b753e90c
commit
9599341195
@ -291,6 +291,11 @@ JSBool
|
||||
xpc_DumpJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, JSBool showThisProps)
|
||||
{
|
||||
char* buf;
|
||||
JSExceptionState *state = JS_SaveExceptionState(cx);
|
||||
if(!state)
|
||||
puts("Call to a debug function modifying state!");
|
||||
|
||||
JS_ClearPendingException(cx);
|
||||
|
||||
buf = FormatJSStackDump(cx, nsnull, showArgs, showLocals, showThisProps);
|
||||
if(buf)
|
||||
@ -300,6 +305,8 @@ xpc_DumpJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, JSBool showTh
|
||||
}
|
||||
else
|
||||
puts("Failed to format JavaScript stack for dump");
|
||||
|
||||
JS_RestoreExceptionState(cx, state);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user