Bug 807179 - Add a constructor for JSPropertyDescriptor. r=luke

This commit is contained in:
Bobby Holley 2012-11-05 17:49:44 -08:00
parent 68d4fa0e36
commit 327f8ca891
3 changed files with 4 additions and 3 deletions

View File

@ -4413,6 +4413,10 @@ struct JSPropertyDescriptor {
JSPropertyOp getter;
JSStrictPropertyOp setter;
jsval value;
JSPropertyDescriptor() : obj(NULL), attrs(0), shortid(0), getter(NULL),
setter(NULL), value(JSVAL_VOID)
{}
};
/*

View File

@ -414,7 +414,6 @@ ExposedPropertiesOnly::check(JSContext *cx, JSObject *wrapper, jsid id, Wrapper:
Access access = NO_ACCESS;
JSPropertyDescriptor desc;
memset(&desc, 0, sizeof(desc));
if (!JS_GetPropertyDescriptorById(cx, hallpass, id, JSRESOLVE_QUALIFIED, &desc)) {
return false; // Error
}

View File

@ -72,7 +72,6 @@ ChromeObjectWrapper::has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
// Try the prototype if that failed.
MOZ_ASSERT(js::IsObjectInContextCompartment(wrapper, cx));
JSPropertyDescriptor desc;
memset(&desc, 0, sizeof(desc));
if (!JS_GetPropertyDescriptorById(cx, wrapperProto, id, 0, &desc))
return false;
*bp = !!desc.obj;
@ -87,7 +86,6 @@ ChromeObjectWrapper::get(JSContext *cx, JSObject *wrapper, JSObject *receiver,
// this because the call signature of ::get doesn't give us any way to
// determine the object upon which the property was found.
JSPropertyDescriptor desc;
memset(&desc, 0, sizeof(desc));
if (!ChromeObjectWrapperBase::getPropertyDescriptor(cx, wrapper, id, false,
&desc)) {
return false;