Checking in shaver's patch for bug 275742: E4X for JS components, r=me.

This commit is contained in:
brendan%mozilla.org 2005-01-04 23:56:56 +00:00
parent 9b06b9b0f5
commit 5d3435f4a6
2 changed files with 7 additions and 2 deletions

View File

@ -1143,6 +1143,8 @@ JSCLAutoContext::JSCLAutoContext(JSRuntime* rt)
}
if (mContext) {
mSavedOptions = JS_GetOptions(mContext);
JS_SetOptions(mContext, mSavedOptions | JSOPTION_XML);
mContextThread = JS_GetContextThread(mContext);
if (mContextThread) {
JS_BeginRequest(mContext);
@ -1156,9 +1158,11 @@ JSCLAutoContext::JSCLAutoContext(JSRuntime* rt)
JSCLAutoContext::~JSCLAutoContext()
{
if (mContext && mContextThread) {
if (mContext) {
JS_ClearNewbornRoots(mContext);
JS_EndRequest(mContext);
JS_SetOptions(mContext, mSavedOptions);
if (mContextThread)
JS_EndRequest(mContext);
}
if (mPopNeeded) {

View File

@ -111,6 +111,7 @@ private:
nsresult mError;
JSBool mPopNeeded;
intN mContextThread;
uint32 mSavedOptions;
};