fix bug 125430. Unbust Components.returnCode by not setting the JSPROP_READONLY bit on the read/write property. r=bzbarsky sr=jst

This commit is contained in:
jband%netscape.com 2002-02-15 03:33:37 +00:00
parent 90a78e1012
commit 1ef661eab1

View File

@ -1634,9 +1634,13 @@ nsXPCComponents::NewResolve(nsIXPConnectWrappedNative *wrapper,
return NS_ERROR_FAILURE;
jsid idid;
uintN attrs = 0;
if(id == rt->GetStringJSVal(XPCJSRuntime::IDX_LAST_RESULT))
{
idid = rt->GetStringID(XPCJSRuntime::IDX_LAST_RESULT);
attrs = JSPROP_READONLY;
}
else if(id == rt->GetStringJSVal(XPCJSRuntime::IDX_RETURN_CODE))
idid = rt->GetStringID(XPCJSRuntime::IDX_RETURN_CODE);
else
@ -1645,9 +1649,7 @@ nsXPCComponents::NewResolve(nsIXPConnectWrappedNative *wrapper,
*objp = obj;
*_retval = OBJ_DEFINE_PROPERTY(cx, obj, idid, JSVAL_VOID,
nsnull, nsnull,
JSPROP_ENUMERATE |
JSPROP_READONLY |
JSPROP_PERMANENT,
JSPROP_ENUMERATE | JSPROP_PERMANENT | attrs,
nsnull);
return NS_OK;
}