Bug 88130: XPConnect disturbs exception state of the call-context. This is jband's patch to reorder calls and fix whitspace. r=rginda, sr=jst

This commit is contained in:
dbradley%netscape.com 2001-08-10 19:23:39 +00:00
Родитель 0ea7f4676c
Коммит c473de394e
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -58,7 +58,7 @@ static inline JSExceptionState* DoPreScriptEvaluated(JSContext* cx)
// and addroot, we avoid them if possible by returning null (as opposed to // and addroot, we avoid them if possible by returning null (as opposed to
// a JSExceptionState with no information) when there is no pending // a JSExceptionState with no information) when there is no pending
// exception. // exception.
if (JS_IsExceptionPending(cx)) if(JS_IsExceptionPending(cx))
return JS_SaveExceptionState(cx); return JS_SaveExceptionState(cx);
return nsnull; return nsnull;
@ -66,12 +66,12 @@ static inline JSExceptionState* DoPreScriptEvaluated(JSContext* cx)
static inline void DoPostScriptEvaluated(JSContext* cx, JSExceptionState* state) static inline void DoPostScriptEvaluated(JSContext* cx, JSExceptionState* state)
{ {
if(state)
JS_RestoreExceptionState(cx, state);
if(JS_GetContextThread(cx)) if(JS_GetContextThread(cx))
JS_EndRequest(cx); JS_EndRequest(cx);
if (state)
JS_RestoreExceptionState(cx, state);
#ifndef XPCONNECT_STANDALONE #ifndef XPCONNECT_STANDALONE
// If this is a DOM JSContext, then notify nsIScriptContext of script // If this is a DOM JSContext, then notify nsIScriptContext of script
// completion so that it can reset its infinite loop detection mechanism. // completion so that it can reset its infinite loop detection mechanism.