mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Clear the pending exception before dispatching any events and potentially running JS on a context that already has an exception thrown. bug 329046, r=brendan sr=jst
This commit is contained in:
parent
dd66394dd2
commit
d2ec11391a
@ -169,6 +169,10 @@ NS_ScriptErrorReporter(JSContext *cx,
|
||||
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
||||
// Note: we must do this before running any more code on cx (if cx is the
|
||||
// dynamic script context).
|
||||
::JS_ClearPendingException(cx);
|
||||
|
||||
if (context) {
|
||||
nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(context->GetGlobalObject()));
|
||||
|
||||
@ -320,9 +324,6 @@ NS_ScriptErrorReporter(JSContext *cx,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// XXX do we really want to be doing this?
|
||||
::JS_ClearPendingException(cx);
|
||||
}
|
||||
|
||||
JS_STATIC_DLL_CALLBACK(JSBool)
|
||||
|
Loading…
Reference in New Issue
Block a user