Bug 196683 - Remove infinite recursion loop check in XPC_WN_Helper_NewResolve (And other resolvers). r=brendan, sr=jst

This commit is contained in:
dbradley%netscape.com 2003-04-21 13:05:25 +00:00
parent ae3f2bc1ed
commit f19f82960a

View File

@ -500,7 +500,7 @@ XPC_WN_OnlyIWrite_PropertyStub(JSContext *cx, JSObject *obj, jsval idval, jsval
XPCWrappedNative* wrapper = ccx.GetWrapper();
THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
// Avoid infinite recursion on getter/setter re-lookup.
// Allow only XPConnect to add the property
if(ccx.GetResolveName() == idval)
return JS_TRUE;
@ -719,10 +719,6 @@ XPC_WN_NoHelper_Resolve(JSContext *cx, JSObject *obj, jsval idval)
if(ccx.GetInterface() && !ccx.GetStaticMemberIsLocal())
return JS_TRUE;
// Avoid infinite recursion on getter/setter re-lookup.
if(ccx.GetResolveName() == idval)
return JS_TRUE;
return DefinePropertyIfFound(ccx, obj, idval,
set, nsnull, nsnull, wrapper->GetScope(),
JS_TRUE, wrapper, wrapper, nsnull,
@ -907,10 +903,6 @@ XPC_WN_Helper_NewResolve(JSContext *cx, JSObject *obj, jsval idval, uintN flags,
XPCWrappedNative* wrapper = ccx.GetWrapper();
THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
// Avoid infinite recursion on getter/setter re-lookup.
if(ccx.GetResolveName() == idval)
return JS_TRUE;
jsval old = ccx.SetResolveName(idval);
nsresult rv = NS_OK;
@ -1411,10 +1403,6 @@ XPC_WN_ModsAllowed_Proto_Resolve(JSContext *cx, JSObject *obj, jsval idval)
if(!ccx.IsValid())
return JS_FALSE;
// Avoid infinite recursion on getter/setter re-lookup.
if(ccx.GetResolveName() == idval)
return JS_TRUE;
XPCNativeScriptableInfo* si = self->GetScriptableInfo();
uintN enumFlag = (si && si->GetFlags().DontEnumStaticProps()) ?
0 : JSPROP_ENUMERATE;
@ -1471,6 +1459,7 @@ XPC_WN_OnlyIWrite_Proto_PropertyStub(JSContext *cx, JSObject *obj, jsval idval,
if(!ccx.IsValid())
return JS_FALSE;
// Allow XPConnect to add the property only
if(ccx.GetResolveName() == idval)
return JS_TRUE;
@ -1494,10 +1483,6 @@ XPC_WN_NoMods_Proto_Resolve(JSContext *cx, JSObject *obj, jsval idval)
if(!ccx.IsValid())
return JS_FALSE;
// Avoid infinite recursion on getter/setter re-lookup.
if(ccx.GetResolveName() == idval)
return JS_TRUE;
XPCNativeScriptableInfo* si = self->GetScriptableInfo();
uintN enumFlag = (si && si->GetFlags().DontEnumStaticProps()) ?
0 : JSPROP_ENUMERATE;
@ -1576,10 +1561,6 @@ XPC_WN_TearOff_Resolve(JSContext *cx, JSObject *obj, jsval idval)
if(!to || nsnull == (iface = to->GetInterface()))
return Throw(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO, cx);
// Avoid infinite recursion on getter/setter re-lookup.
if(ccx.GetResolveName() == idval)
return JS_TRUE;
return DefinePropertyIfFound(ccx, obj, idval, nsnull, iface, nsnull,
wrapper->GetScope(),
JS_TRUE, nsnull, nsnull, nsnull,