зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1669556 - Remove XrayUtils::HasNativeProperty. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D92681
This commit is contained in:
Родитель
00b133dff8
Коммит
347101914e
|
@ -47,8 +47,6 @@ using js::Wrapper;
|
||||||
|
|
||||||
namespace xpc {
|
namespace xpc {
|
||||||
|
|
||||||
using namespace XrayUtils;
|
|
||||||
|
|
||||||
#define Between(x, a, b) (a <= x && x <= b)
|
#define Between(x, a, b) (a <= x && x <= b)
|
||||||
|
|
||||||
static_assert(JSProto_URIError - JSProto_Error == 8,
|
static_assert(JSProto_URIError - JSProto_Error == 8,
|
||||||
|
@ -1834,34 +1832,6 @@ const JSClass* DOMXrayTraits::getExpandoClass(JSContext* cx,
|
||||||
return XrayGetExpandoClass(cx, target);
|
return XrayGetExpandoClass(cx, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace XrayUtils {
|
|
||||||
|
|
||||||
bool HasNativeProperty(JSContext* cx, HandleObject wrapper, HandleId id,
|
|
||||||
bool* hasProp) {
|
|
||||||
MOZ_ASSERT(WrapperFactory::IsXrayWrapper(wrapper));
|
|
||||||
XrayTraits* traits = GetXrayTraits(wrapper);
|
|
||||||
MOZ_ASSERT(traits);
|
|
||||||
RootedObject target(cx, XrayTraits::getTargetObject(wrapper));
|
|
||||||
RootedObject holder(cx, traits->ensureHolder(cx, wrapper));
|
|
||||||
NS_ENSURE_TRUE(holder, false);
|
|
||||||
*hasProp = false;
|
|
||||||
Rooted<PropertyDescriptor> desc(cx);
|
|
||||||
|
|
||||||
// Try resolveOwnProperty.
|
|
||||||
if (!traits->resolveOwnProperty(cx, wrapper, target, holder, id, &desc)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (desc.object()) {
|
|
||||||
*hasProp = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try the holder.
|
|
||||||
return JS_AlreadyHasOwnPropertyById(cx, holder, id, hasProp);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace XrayUtils
|
|
||||||
|
|
||||||
template <typename Base, typename Traits>
|
template <typename Base, typename Traits>
|
||||||
bool XrayWrapper<Base, Traits>::preventExtensions(
|
bool XrayWrapper<Base, Traits>::preventExtensions(
|
||||||
JSContext* cx, HandleObject wrapper, ObjectOpResult& result) const {
|
JSContext* cx, HandleObject wrapper, ObjectOpResult& result) const {
|
||||||
|
|
|
@ -35,14 +35,6 @@ class nsIPrincipal;
|
||||||
|
|
||||||
namespace xpc {
|
namespace xpc {
|
||||||
|
|
||||||
namespace XrayUtils {
|
|
||||||
|
|
||||||
bool IsTransparent(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id);
|
|
||||||
|
|
||||||
bool HasNativeProperty(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id,
|
|
||||||
bool* hasProp);
|
|
||||||
} // namespace XrayUtils
|
|
||||||
|
|
||||||
enum XrayType {
|
enum XrayType {
|
||||||
XrayForDOMObject,
|
XrayForDOMObject,
|
||||||
XrayForJSObject,
|
XrayForJSObject,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче