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:
mrbkap%gmail.com 2006-03-02 23:09:43 +00:00
parent dd66394dd2
commit d2ec11391a

View File

@ -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)