From c473de394ec5b1cb0852d0b62b2bb823502f8eed Mon Sep 17 00:00:00 2001 From: "dbradley%netscape.com" Date: Fri, 10 Aug 2001 19:23:39 +0000 Subject: [PATCH] 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 --- js/src/xpconnect/src/xpcwrappedjsclass.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/src/xpconnect/src/xpcwrappedjsclass.cpp b/js/src/xpconnect/src/xpcwrappedjsclass.cpp index f6a398ac7c2..7e55b111631 100644 --- a/js/src/xpconnect/src/xpcwrappedjsclass.cpp +++ b/js/src/xpconnect/src/xpcwrappedjsclass.cpp @@ -58,7 +58,7 @@ static inline JSExceptionState* DoPreScriptEvaluated(JSContext* cx) // and addroot, we avoid them if possible by returning null (as opposed to // a JSExceptionState with no information) when there is no pending // exception. - if (JS_IsExceptionPending(cx)) + if(JS_IsExceptionPending(cx)) return JS_SaveExceptionState(cx); return nsnull; @@ -66,12 +66,12 @@ static inline JSExceptionState* DoPreScriptEvaluated(JSContext* cx) static inline void DoPostScriptEvaluated(JSContext* cx, JSExceptionState* state) { + if(state) + JS_RestoreExceptionState(cx, state); + if(JS_GetContextThread(cx)) JS_EndRequest(cx); - if (state) - JS_RestoreExceptionState(cx, state); - #ifndef XPCONNECT_STANDALONE // If this is a DOM JSContext, then notify nsIScriptContext of script // completion so that it can reset its infinite loop detection mechanism.