Bug 1132187 part 2. Remove the WANT_DELPROPERTY bit. r=peterv

This commit is contained in:
Boris Zbarsky 2015-02-13 14:34:54 -05:00
parent ebbad0e9f4
commit 0605bcb783
5 changed files with 3 additions and 40 deletions

View File

@ -904,15 +904,6 @@ nsDOMClassInfo::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP
nsDOMClassInfo::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, bool *_retval)
{
NS_WARNING("nsDOMClassInfo::DelProperty Don't call me!");
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP
nsDOMClassInfo::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp,

View File

@ -32,7 +32,7 @@ interface nsIXPConnectWrappedNative;
* boolean to PR_TRUE before making the call. Implementations may skip writing
* to *_retval unless they want to return PR_FALSE.
*/
[uuid(82755b3f-fd81-4efe-aa14-d4743fbedda1)]
[uuid(bdefff68-b286-449c-af13-bebc7dd25af7)]
interface nsIXPCScriptable : nsISupports
{
/* bitflags used for 'flags' (only 32 bits available!) */
@ -41,7 +41,7 @@ interface nsIXPCScriptable : nsISupports
// unused bit here
// unused bit here
const uint32_t WANT_ADDPROPERTY = 1 << 3;
const uint32_t WANT_DELPROPERTY = 1 << 4;
// unused bit here
const uint32_t WANT_GETPROPERTY = 1 << 5;
const uint32_t WANT_SETPROPERTY = 1 << 6;
const uint32_t WANT_ENUMERATE = 1 << 7;
@ -81,9 +81,6 @@ interface nsIXPCScriptable : nsISupports
in JSContextPtr cx, in JSObjectPtr obj, in jsid id,
in JSValPtr vp);
boolean delProperty(in nsIXPConnectWrappedNative wrapper,
in JSContextPtr cx, in JSObjectPtr obj, in jsid id);
// The returnCode should be set to NS_SUCCESS_I_DID_SOMETHING if
// this method does something.
boolean getProperty(in nsIXPConnectWrappedNative wrapper,

View File

@ -37,9 +37,6 @@ XPC_MAP_CLASSNAME::GetScriptableFlags()
#ifdef XPC_MAP_WANT_ADDPROPERTY
nsIXPCScriptable::WANT_ADDPROPERTY |
#endif
#ifdef XPC_MAP_WANT_DELPROPERTY
nsIXPCScriptable::WANT_DELPROPERTY |
#endif
#ifdef XPC_MAP_WANT_GETPROPERTY
nsIXPCScriptable::WANT_GETPROPERTY |
#endif
@ -89,11 +86,6 @@ NS_IMETHODIMP XPC_MAP_CLASSNAME::AddProperty(nsIXPConnectWrappedNative *wrapper,
{NS_ERROR("never called"); return NS_ERROR_NOT_IMPLEMENTED;}
#endif
#ifndef XPC_MAP_WANT_DELPROPERTY
NS_IMETHODIMP XPC_MAP_CLASSNAME::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj, jsid id, bool *_retval)
{NS_ERROR("never called"); return NS_ERROR_NOT_IMPLEMENTED;}
#endif
#ifndef XPC_MAP_WANT_GETPROPERTY
NS_IMETHODIMP XPC_MAP_CLASSNAME::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj, jsid id, JS::Value * vp, bool *_retval)
{NS_WARNING("never called"); return NS_ERROR_NOT_IMPLEMENTED;}
@ -162,10 +154,6 @@ NS_IMETHODIMP XPC_MAP_CLASSNAME::PostCreatePrototype(JSContext *cx, JSObject *pr
#undef XPC_MAP_WANT_ADDPROPERTY
#endif
#ifdef XPC_MAP_WANT_DELPROPERTY
#undef XPC_MAP_WANT_DELPROPERTY
#endif
#ifdef XPC_MAP_WANT_GETPROPERTY
#undef XPC_MAP_WANT_GETPROPERTY
#endif

View File

@ -762,16 +762,6 @@ XPC_WN_Helper_AddProperty(JSContext *cx, HandleObject obj, HandleId id,
POST_HELPER_STUB
}
static bool
XPC_WN_Helper_DelProperty(JSContext *cx, HandleObject obj, HandleId id,
bool *succeeded)
{
*succeeded = true;
PRE_HELPER_STUB
DelProperty(wrapper, cx, obj, id, &retval);
POST_HELPER_STUB
}
bool
XPC_WN_Helper_GetProperty(JSContext *cx, HandleObject obj, HandleId id,
MutableHandleValue vp)
@ -1028,9 +1018,7 @@ XPCNativeScriptableShared::PopulateJSClass()
mJSClass.base.addProperty = addProperty;
JSDeletePropertyOp delProperty;
if (mFlags.WantDelProperty())
delProperty = XPC_WN_Helper_DelProperty;
else if (mFlags.UseJSStubForDelProperty())
if (mFlags.UseJSStubForDelProperty())
delProperty = nullptr;
else if (mFlags.AllowPropModsDuringResolve())
delProperty = XPC_WN_MaybeResolvingDeletePropertyStub;

View File

@ -1614,7 +1614,6 @@ public:
bool WantPreCreate() GET_IT(WANT_PRECREATE)
bool WantAddProperty() GET_IT(WANT_ADDPROPERTY)
bool WantDelProperty() GET_IT(WANT_DELPROPERTY)
bool WantGetProperty() GET_IT(WANT_GETPROPERTY)
bool WantSetProperty() GET_IT(WANT_SETPROPERTY)
bool WantEnumerate() GET_IT(WANT_ENUMERATE)