зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1165722 - Replace JS_GetPropertyDescriptor usage in Xray code. r=bholley
This commit is contained in:
Родитель
8b3a3efd8b
Коммит
a65f7266fe
|
@ -459,7 +459,7 @@ JSXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
|
|||
// muddles through by only checking the holder for non-|own| lookups, but
|
||||
// that doesn't work for us. So we do an explicit holder check here, and hope
|
||||
// that this mess gets fixed up soon.
|
||||
if (!JS_GetPropertyDescriptorById(cx, holder, id, desc))
|
||||
if (!JS_GetOwnPropertyDescriptorById(cx, holder, id, desc))
|
||||
return false;
|
||||
if (desc.object()) {
|
||||
desc.object().set(wrapper);
|
||||
|
@ -521,13 +521,13 @@ JSXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
|
|||
if (!fun)
|
||||
return false;
|
||||
|
||||
// The generic Xray machinery only defines non-own properties on the holder.
|
||||
// This is broken, and will be fixed at some point, but for now we need to
|
||||
// cache the value explicitly. See the corresponding call to
|
||||
// JS_GetPropertyById at the top of this function.
|
||||
// The generic Xray machinery only defines non-own properties of the target on
|
||||
// the holder. This is broken, and will be fixed at some point, but for now we
|
||||
// need to cache the value explicitly. See the corresponding call to
|
||||
// JS_GetOwnPropertyDescriptorById at the top of this function.
|
||||
RootedObject funObj(cx, JS_GetFunctionObject(fun));
|
||||
return JS_DefinePropertyById(cx, holder, id, funObj, 0) &&
|
||||
JS_GetPropertyDescriptorById(cx, holder, id, desc);
|
||||
JS_GetOwnPropertyDescriptorById(cx, holder, id, desc);
|
||||
}
|
||||
|
||||
// Scan through the properties.
|
||||
|
@ -580,7 +580,7 @@ JSXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
|
|||
desc.attributes(),
|
||||
JS_PROPERTYOP_GETTER(desc.getter()),
|
||||
JS_PROPERTYOP_SETTER(desc.setter())) &&
|
||||
JS_GetPropertyDescriptorById(cx, holder, id, desc);
|
||||
JS_GetOwnPropertyDescriptorById(cx, holder, id, desc);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1242,7 +1242,7 @@ XPCWrappedNativeXrayTraits::resolveNativeProperty(JSContext* cx, HandleObject wr
|
|||
ObjectValue(*JS_GetFunctionObject(toString)));
|
||||
|
||||
return JS_DefinePropertyById(cx, holder, id, desc) &&
|
||||
JS_GetPropertyDescriptorById(cx, holder, id, desc);
|
||||
JS_GetOwnPropertyDescriptorById(cx, holder, id, desc);
|
||||
}
|
||||
|
||||
desc.object().set(holder);
|
||||
|
@ -1335,7 +1335,7 @@ XrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
|
|||
bool found = false;
|
||||
if (expando) {
|
||||
JSAutoCompartment ac(cx, expando);
|
||||
if (!JS_GetPropertyDescriptorById(cx, expando, id, desc))
|
||||
if (!JS_GetOwnPropertyDescriptorById(cx, expando, id, desc))
|
||||
return false;
|
||||
found = !!desc.object();
|
||||
}
|
||||
|
@ -1381,7 +1381,7 @@ XrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
|
|||
wrappedJSObject_getter)) {
|
||||
return false;
|
||||
}
|
||||
if (!JS_GetPropertyDescriptorById(cx, holder, id, desc))
|
||||
if (!JS_GetOwnPropertyDescriptorById(cx, holder, id, desc))
|
||||
return false;
|
||||
desc.object().set(wrapper);
|
||||
return true;
|
||||
|
@ -1429,7 +1429,7 @@ XPCWrappedNativeXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsW
|
|||
// in the wrapper's compartment here, not the wrappee.
|
||||
MOZ_ASSERT(js::IsObjectInContextCompartment(wrapper, cx));
|
||||
|
||||
return JS_GetPropertyDescriptorById(cx, holder, id, desc);
|
||||
return JS_GetOwnPropertyDescriptorById(cx, holder, id, desc);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1572,7 +1572,7 @@ DOMXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper, Handl
|
|||
}
|
||||
}
|
||||
|
||||
if (!JS_GetPropertyDescriptorById(cx, holder, id, desc))
|
||||
if (!JS_GetOwnPropertyDescriptorById(cx, holder, id, desc))
|
||||
return false;
|
||||
if (desc.object()) {
|
||||
desc.object().set(wrapper);
|
||||
|
@ -1590,7 +1590,7 @@ DOMXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper, Handl
|
|||
return true;
|
||||
|
||||
return JS_DefinePropertyById(cx, holder, id, desc) &&
|
||||
JS_GetPropertyDescriptorById(cx, holder, id, desc);
|
||||
JS_GetOwnPropertyDescriptorById(cx, holder, id, desc);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1866,7 +1866,7 @@ XrayWrapper<Base, Traits>::getPropertyDescriptor(JSContext* cx, HandleObject wra
|
|||
return false;
|
||||
|
||||
// Check the holder.
|
||||
if (!desc.object() && !JS_GetPropertyDescriptorById(cx, holder, id, desc))
|
||||
if (!desc.object() && !JS_GetOwnPropertyDescriptorById(cx, holder, id, desc))
|
||||
return false;
|
||||
if (desc.object()) {
|
||||
desc.object().set(wrapper);
|
||||
|
@ -1908,7 +1908,7 @@ XrayWrapper<Base, Traits>::getPropertyDescriptor(JSContext* cx, HandleObject wra
|
|||
return true;
|
||||
|
||||
if (!JS_DefinePropertyById(cx, holder, id, desc) ||
|
||||
!JS_GetPropertyDescriptorById(cx, holder, id, desc))
|
||||
!JS_GetOwnPropertyDescriptorById(cx, holder, id, desc))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче