Bug 1242214 - Rename JSPropertyDescriptor JS::PropertyDescriptor in js. r=sstangl

This commit is contained in:
Tom Schuster 2016-01-28 11:28:04 +01:00
parent 0046188781
commit e1fabbba96
49 changed files with 219 additions and 218 deletions

View File

@ -522,7 +522,7 @@ JavaScriptShared::findObjectById(JSContext* cx, const ObjectId& objId)
static const uint64_t UnknownPropertyOp = 1;
bool
JavaScriptShared::fromDescriptor(JSContext* cx, Handle<JSPropertyDescriptor> desc,
JavaScriptShared::fromDescriptor(JSContext* cx, Handle<PropertyDescriptor> desc,
PPropertyDescriptor* out)
{
out->attrs() = desc.attributes();
@ -578,7 +578,7 @@ UnknownStrictPropertyStub(JSContext* cx, HandleObject obj, HandleId id, MutableH
bool
JavaScriptShared::toDescriptor(JSContext* cx, const PPropertyDescriptor& in,
MutableHandle<JSPropertyDescriptor> out)
MutableHandle<PropertyDescriptor> out)
{
out.setAttributes(in.attrs());
if (!fromVariant(cx, in.value(), out.value()))

View File

@ -155,10 +155,10 @@ class JavaScriptShared : public CPOWManager
bool toSymbolVariant(JSContext* cx, JS::Symbol* sym, SymbolVariant* symVarp);
JS::Symbol* fromSymbolVariant(JSContext* cx, SymbolVariant symVar);
bool fromDescriptor(JSContext* cx, JS::Handle<JSPropertyDescriptor> desc,
bool fromDescriptor(JSContext* cx, JS::Handle<JS::PropertyDescriptor> desc,
PPropertyDescriptor* out);
bool toDescriptor(JSContext* cx, const PPropertyDescriptor& in,
JS::MutableHandle<JSPropertyDescriptor> out);
JS::MutableHandle<JS::PropertyDescriptor> out);
bool toObjectOrNullVariant(JSContext* cx, JSObject* obj, ObjectOrNullVariant* objVarp);
JSObject* fromObjectOrNullVariant(JSContext* cx, ObjectOrNullVariant objVar);

View File

@ -124,7 +124,7 @@ WrapperAnswer::RecvGetPropertyDescriptor(const ObjectId& objId, const JSIDVarian
if (!fromJSIDVariant(cx, idVar, &id))
return fail(jsapi, rs);
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!JS_GetPropertyDescriptorById(cx, obj, id, &desc))
return fail(jsapi, rs);
@ -155,7 +155,7 @@ WrapperAnswer::RecvGetOwnPropertyDescriptor(const ObjectId& objId, const JSIDVar
if (!fromJSIDVariant(cx, idVar, &id))
return fail(jsapi, rs);
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!JS_GetOwnPropertyDescriptorById(cx, obj, id, &desc))
return fail(jsapi, rs);
@ -185,7 +185,7 @@ WrapperAnswer::RecvDefineProperty(const ObjectId& objId, const JSIDVariant& idVa
if (!fromJSIDVariant(cx, idVar, &id))
return fail(jsapi, rs);
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!toDescriptor(cx, descriptor, &desc))
return fail(jsapi, rs);

View File

@ -98,9 +98,9 @@ class CPOWProxyHandler : public BaseProxyHandler
}
virtual bool getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const override;
virtual bool ownPropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props) const override;
@ -119,7 +119,7 @@ class CPOWProxyHandler : public BaseProxyHandler
virtual bool construct(JSContext* cx, HandleObject proxy, const CallArgs& args) const override;
virtual bool getPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool hasOwn(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const override;
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props) const override;
@ -161,14 +161,14 @@ const CPOWProxyHandler CPOWProxyHandler::singleton;
bool
CPOWProxyHandler::getPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const
MutableHandle<PropertyDescriptor> desc) const
{
FORWARD(getPropertyDescriptor, (cx, proxy, id, desc));
}
bool
WrapperOwner::getPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
ObjectId objId = idOf(proxy);
@ -191,14 +191,14 @@ WrapperOwner::getPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId
bool
CPOWProxyHandler::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const
MutableHandle<PropertyDescriptor> desc) const
{
FORWARD(getOwnPropertyDescriptor, (cx, proxy, id, desc));
}
bool
WrapperOwner::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
ObjectId objId = idOf(proxy);
@ -221,7 +221,7 @@ WrapperOwner::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, Handle
bool
CPOWProxyHandler::defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const
{
FORWARD(defineProperty, (cx, proxy, id, desc, result));
@ -229,7 +229,7 @@ CPOWProxyHandler::defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
bool
WrapperOwner::defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result)
{
ObjectId objId = idOf(proxy);
@ -452,7 +452,7 @@ WrapperOwner::DOMQI(JSContext* cx, JS::HandleObject proxy, JS::CallArgs& args)
// We could stash the actual QI function on our own function object to avoid
// if we're called multiple times, but since we're transient, there's no
// point right now.
JS::Rooted<JSPropertyDescriptor> propDesc(cx);
JS::Rooted<PropertyDescriptor> propDesc(cx);
if (!JS_GetPropertyDescriptor(cx, proxy, "QueryInterface", &propDesc))
return false;

View File

@ -30,9 +30,9 @@ class WrapperOwner : public virtual JavaScriptShared
// Standard internal methods.
// (The traps should be in the same order like js/Proxy.h)
bool getOwnPropertyDescriptor(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
bool defineProperty(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::ObjectOpResult& result);
bool ownPropertyKeys(JSContext* cx, JS::HandleObject proxy, JS::AutoIdVector& props);
bool delete_(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
@ -49,7 +49,7 @@ class WrapperOwner : public virtual JavaScriptShared
// SpiderMonkey extensions.
bool getPropertyDescriptor(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
bool hasOwn(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, bool* bp);
bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::HandleObject proxy,
JS::AutoIdVector& props);

View File

@ -412,7 +412,7 @@ typedef bool
JS::MutableHandleObject objp, JS::MutableHandle<Shape*> propp);
typedef bool
(* DefinePropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::ObjectOpResult& result);
typedef bool
(* HasPropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool* foundp);
@ -424,7 +424,7 @@ typedef bool
JS::HandleValue receiver, JS::ObjectOpResult& result);
typedef bool
(* GetOwnPropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
typedef bool
(* DeletePropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::ObjectOpResult& result);

View File

@ -29,6 +29,7 @@ using JS::MutableHandleValue;
using JS::NativeImpl;
using JS::ObjectOpResult;
using JS::PrivateValue;
using JS::PropertyDescriptor;
using JS::Value;
class RegExpGuard;
@ -251,9 +252,9 @@ class JS_FRIEND_API(BaseProxyHandler)
/* Standard internal methods. */
virtual bool getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const = 0;
MutableHandle<PropertyDescriptor> desc) const = 0;
virtual bool defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const = 0;
virtual bool ownPropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props) const = 0;
@ -315,7 +316,7 @@ class JS_FRIEND_API(BaseProxyHandler)
/* SpiderMonkey extensions. */
virtual bool getPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const;
MutableHandle<PropertyDescriptor> desc) const;
virtual bool hasOwn(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const;
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props) const;
@ -374,9 +375,9 @@ class JS_FRIEND_API(DirectProxyHandler) : public BaseProxyHandler
/* Standard internal methods. */
virtual bool getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const override;
virtual bool ownPropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props) const override;
@ -404,7 +405,7 @@ class JS_FRIEND_API(DirectProxyHandler) : public BaseProxyHandler
/* SpiderMonkey extensions. */
virtual bool getPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool hasOwn(JSContext* cx, HandleObject proxy, HandleId id,
bool* bp) const override;
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy,

View File

@ -49,6 +49,8 @@ class MOZ_STACK_CLASS SourceBufferHolder;
class HandleValueArray;
class ObjectOpResult;
struct PropertyDescriptor;
} // namespace JS
// Do the importing.
@ -148,6 +150,8 @@ using JS::HandleValueArray;
using JS::ObjectOpResult;
using JS::PropertyDescriptor;
using JS::Zone;
} /* namespace js */

View File

@ -382,7 +382,7 @@ ModuleNamespaceObject::ProxyHandler::preventExtensions(JSContext* cx, HandleObje
bool
ModuleNamespaceObject::ProxyHandler::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy,
HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const
MutableHandle<PropertyDescriptor> desc) const
{
Rooted<ModuleNamespaceObject*> ns(cx, &proxy->as<ModuleNamespaceObject>());
if (JSID_IS_SYMBOL(id)) {
@ -422,7 +422,7 @@ ModuleNamespaceObject::ProxyHandler::getOwnPropertyDescriptor(JSContext* cx, Han
bool
ModuleNamespaceObject::ProxyHandler::defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const
{
return result.failReadOnly();

View File

@ -152,9 +152,9 @@ class ModuleNamespaceObject : public ProxyObject
JS::Value getEnumerateFunction(HandleObject proxy) const;
bool getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
bool defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const override;
bool ownPropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props) const override;

View File

@ -140,7 +140,7 @@ Reflect_defineProperty(JSContext* cx, unsigned argc, Value* vp)
return false;
// Steps 4-5.
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!ToPropertyDescriptor(cx, args.get(2), true, &desc))
return false;

View File

@ -1743,7 +1743,7 @@ ReportPropertyError(JSContext* cx,
bool
TypedObject::obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result)
{
Rooted<TypedObject*> typedObj(cx, &obj->as<TypedObject>());
@ -1963,7 +1963,7 @@ TypedObject::obj_setProperty(JSContext* cx, HandleObject obj, HandleId id, Handl
bool
TypedObject::obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
Rooted<TypedObject*> typedObj(cx, &obj->as<TypedObject>());
if (!typedObj->isAttached()) {

View File

@ -506,7 +506,7 @@ class TypedObject : public JSObject
MutableHandleShape propp);
static bool obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result);
static bool obj_hasProperty(JSContext* cx, HandleObject obj, HandleId id, bool* foundp);
@ -521,7 +521,7 @@ class TypedObject : public JSObject
HandleValue receiver, ObjectOpResult& result);
static bool obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc);
MutableHandle<PropertyDescriptor> desc);
static bool obj_deleteProperty(JSContext* cx, HandleObject obj, HandleId id,
ObjectOpResult& result);

View File

@ -189,7 +189,7 @@ StackShape::trace(JSTracer* trc)
}
void
JSPropertyDescriptor::trace(JSTracer* trc)
PropertyDescriptor::trace(JSTracer* trc)
{
if (obj)
TraceRoot(trc, &obj, "Descriptor::obj");

View File

@ -45,7 +45,7 @@ BEGIN_TEST(testDefineGetterSetterNonEnumerable)
JS_DATA_TO_FUNC_PTR(JSNative, (JSObject*) funGetObj),
JS_DATA_TO_FUNC_PTR(JSNative, (JSObject*) funSetObj)));
JS::Rooted<JSPropertyDescriptor> desc(cx);
JS::Rooted<JS::PropertyDescriptor> desc(cx);
CHECK(JS_GetOwnPropertyDescriptor(cx, vObject, PROPERTY_NAME, &desc));
CHECK(desc.object());
CHECK(desc.hasGetterObject());

View File

@ -20,7 +20,7 @@ enum PropertyDescriptorKind {
};
static bool
CheckDescriptor(JS::Handle<JSPropertyDescriptor> desc, PropertyDescriptorKind kind,
CheckDescriptor(JS::Handle<JS::PropertyDescriptor> desc, PropertyDescriptorKind kind,
bool enumerable, bool writable, bool configurable)
{
if (!desc.object())
@ -39,7 +39,7 @@ CheckDescriptor(JS::Handle<JSPropertyDescriptor> desc, PropertyDescriptorKind ki
BEGIN_TEST(testDefinePropertyIgnoredAttributes)
{
JS::RootedObject obj(cx, JS_NewPlainObject(cx));
JS::Rooted<JSPropertyDescriptor> desc(cx);
JS::Rooted<JS::PropertyDescriptor> desc(cx);
JS::RootedValue defineValue(cx);
// Try a getter. Allow it to fill in the defaults. Because we're passing a

View File

@ -11,7 +11,7 @@ BEGIN_TEST(test_GetPropertyDescriptor)
CHECK(v.isObject());
JS::RootedObject obj(cx, &v.toObject());
JS::Rooted<JSPropertyDescriptor> desc(cx);
JS::Rooted<JS::PropertyDescriptor> desc(cx);
CHECK(JS_GetPropertyDescriptor(cx, obj, "somename", &desc));
CHECK_EQUAL(desc.object(), obj);

View File

@ -16,13 +16,13 @@ class CustomProxyHandler : public DirectProxyHandler {
CustomProxyHandler() : DirectProxyHandler(nullptr) {}
bool getPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override
MutableHandle<PropertyDescriptor> desc) const override
{
return impl(cx, proxy, id, desc, false);
}
bool getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override
MutableHandle<PropertyDescriptor> desc) const override
{
return impl(cx, proxy, id, desc, true);
}
@ -30,7 +30,7 @@ class CustomProxyHandler : public DirectProxyHandler {
bool set(JSContext* cx, HandleObject proxy, HandleId id, HandleValue v, HandleValue receiver,
ObjectOpResult& result) const override
{
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!DirectProxyHandler::getPropertyDescriptor(cx, proxy, id, &desc))
return false;
return SetPropertyIgnoringNamedGetter(cx, proxy, id, v, receiver, desc, result);
@ -38,7 +38,7 @@ class CustomProxyHandler : public DirectProxyHandler {
private:
bool impl(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc, bool ownOnly) const
MutableHandle<PropertyDescriptor> desc, bool ownOnly) const
{
if (JSID_IS_STRING(id)) {
bool match;

View File

@ -2018,7 +2018,7 @@ JS_SetImmutablePrototype(JSContext *cx, JS::HandleObject obj, bool *succeeded)
JS_PUBLIC_API(bool)
JS_GetOwnPropertyDescriptorById(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
@ -2028,7 +2028,7 @@ JS_GetOwnPropertyDescriptorById(JSContext* cx, HandleObject obj, HandleId id,
JS_PUBLIC_API(bool)
JS_GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, const char* name,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
JSAtom* atom = Atomize(cx, name, strlen(name));
if (!atom)
@ -2039,7 +2039,7 @@ JS_GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, const char* name,
JS_PUBLIC_API(bool)
JS_GetOwnUCPropertyDescriptor(JSContext* cx, HandleObject obj, const char16_t* name,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
JSAtom* atom = AtomizeChars(cx, name, js_strlen(name));
if (!atom)
@ -2050,14 +2050,14 @@ JS_GetOwnUCPropertyDescriptor(JSContext* cx, HandleObject obj, const char16_t* n
JS_PUBLIC_API(bool)
JS_GetPropertyDescriptorById(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
return GetPropertyDescriptor(cx, obj, id, desc);
}
JS_PUBLIC_API(bool)
JS_GetPropertyDescriptor(JSContext* cx, HandleObject obj, const char* name,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
JSAtom* atom = Atomize(cx, name, strlen(name));
if (!atom)
@ -2068,7 +2068,7 @@ JS_GetPropertyDescriptor(JSContext* cx, HandleObject obj, const char* name,
static bool
DefinePropertyByDescriptor(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc, ObjectOpResult& result)
Handle<PropertyDescriptor> desc, ObjectOpResult& result)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
@ -2079,14 +2079,14 @@ DefinePropertyByDescriptor(JSContext* cx, HandleObject obj, HandleId id,
JS_PUBLIC_API(bool)
JS_DefinePropertyById(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc, ObjectOpResult& result)
Handle<PropertyDescriptor> desc, ObjectOpResult& result)
{
return DefinePropertyByDescriptor(cx, obj, id, desc, result);
}
JS_PUBLIC_API(bool)
JS_DefinePropertyById(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc)
Handle<PropertyDescriptor> desc)
{
ObjectOpResult result;
return DefinePropertyByDescriptor(cx, obj, id, desc, result) &&
@ -2339,7 +2339,7 @@ JS_DefineProperty(JSContext* cx, HandleObject obj, const char* name, double valu
JS_PUBLIC_API(bool)
JS_DefineUCProperty(JSContext* cx, HandleObject obj, const char16_t* name, size_t namelen,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result)
{
JSAtom* atom = AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen));
@ -2351,7 +2351,7 @@ JS_DefineUCProperty(JSContext* cx, HandleObject obj, const char16_t* name, size_
JS_PUBLIC_API(bool)
JS_DefineUCProperty(JSContext* cx, HandleObject obj, const char16_t* name, size_t namelen,
Handle<JSPropertyDescriptor> desc)
Handle<PropertyDescriptor> desc)
{
JSAtom* atom = AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen));
if (!atom)
@ -3202,7 +3202,7 @@ JS_PUBLIC_API(bool)
JS::ObjectToCompletePropertyDescriptor(JSContext* cx,
HandleObject obj,
HandleValue descObj,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
if (!ToPropertyDescriptor(cx, descObj, true, desc))
return false;

View File

@ -2511,27 +2511,27 @@ JS_FreezeObject(JSContext* cx, JS::Handle<JSObject*> obj);
/*** Property descriptors ************************************************************************/
struct JSPropertyDescriptor : public JS::Traceable {
namespace JS {
struct PropertyDescriptor : public Traceable {
JSObject* obj;
unsigned attrs;
JSGetterOp getter;
JSSetterOp setter;
JS::Value value;
JSPropertyDescriptor()
PropertyDescriptor()
: obj(nullptr), attrs(0), getter(nullptr), setter(nullptr), value(JS::UndefinedValue())
{}
static void trace(JSPropertyDescriptor* self, JSTracer* trc) { self->trace(trc); }
static void trace(PropertyDescriptor* self, JSTracer* trc) { self->trace(trc); }
void trace(JSTracer* trc);
};
namespace JS {
template <typename Outer>
class PropertyDescriptorOperations
{
const JSPropertyDescriptor& desc() const { return static_cast<const Outer*>(this)->get(); }
const PropertyDescriptor& desc() const { return static_cast<const Outer*>(this)->get(); }
bool has(unsigned bit) const {
MOZ_ASSERT(bit != 0);
@ -2663,7 +2663,7 @@ class PropertyDescriptorOperations
template <typename Outer>
class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations<Outer>
{
JSPropertyDescriptor& desc() { return static_cast<Outer*>(this)->get(); }
PropertyDescriptor& desc() { return static_cast<Outer*>(this)->get(); }
public:
void clear() {
@ -2686,7 +2686,7 @@ class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations<
setSetter(setterOp);
}
void assign(JSPropertyDescriptor& other) {
void assign(PropertyDescriptor& other) {
object().set(other.obj);
setAttributes(other.attrs);
setGetter(other.getter);
@ -2774,18 +2774,18 @@ class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations<
namespace js {
template <>
class RootedBase<JSPropertyDescriptor>
: public JS::MutablePropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor>>
class RootedBase<JS::PropertyDescriptor>
: public JS::MutablePropertyDescriptorOperations<JS::Rooted<JS::PropertyDescriptor>>
{};
template <>
class HandleBase<JSPropertyDescriptor>
: public JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor>>
class HandleBase<JS::PropertyDescriptor>
: public JS::PropertyDescriptorOperations<JS::Handle<JS::PropertyDescriptor>>
{};
template <>
class MutableHandleBase<JSPropertyDescriptor>
: public JS::MutablePropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor>>
class MutableHandleBase<JS::PropertyDescriptor>
: public JS::MutablePropertyDescriptorOperations<JS::MutableHandle<JS::PropertyDescriptor>>
{};
} /* namespace js */
@ -2796,7 +2796,7 @@ extern JS_PUBLIC_API(bool)
ObjectToCompletePropertyDescriptor(JSContext* cx,
JS::HandleObject obj,
JS::HandleValue descriptor,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<PropertyDescriptor> desc);
} // namespace JS
@ -2883,15 +2883,15 @@ JS_SetImmutablePrototype(JSContext* cx, JS::HandleObject obj, bool* succeeded);
*/
extern JS_PUBLIC_API(bool)
JS_GetOwnPropertyDescriptorById(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
extern JS_PUBLIC_API(bool)
JS_GetOwnPropertyDescriptor(JSContext* cx, JS::HandleObject obj, const char* name,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
extern JS_PUBLIC_API(bool)
JS_GetOwnUCPropertyDescriptor(JSContext* cx, JS::HandleObject obj, const char16_t* name,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
/**
* Like JS_GetOwnPropertyDescriptorById, but also searches the prototype chain
@ -2901,11 +2901,11 @@ JS_GetOwnUCPropertyDescriptor(JSContext* cx, JS::HandleObject obj, const char16_
*/
extern JS_PUBLIC_API(bool)
JS_GetPropertyDescriptorById(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
extern JS_PUBLIC_API(bool)
JS_GetPropertyDescriptor(JSContext* cx, JS::HandleObject obj, const char* name,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
/**
* Define a property on obj.
@ -2920,7 +2920,7 @@ JS_GetPropertyDescriptor(JSContext* cx, JS::HandleObject obj, const char* name,
*/
extern JS_PUBLIC_API(bool)
JS_DefinePropertyById(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::ObjectOpResult& result);
/**
@ -2929,7 +2929,7 @@ JS_DefinePropertyById(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
*/
extern JS_PUBLIC_API(bool)
JS_DefinePropertyById(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc);
JS::Handle<JS::PropertyDescriptor> desc);
extern JS_PUBLIC_API(bool)
JS_DefinePropertyById(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::HandleValue value,
@ -2981,12 +2981,12 @@ JS_DefineProperty(JSContext* cx, JS::HandleObject obj, const char* name, double
extern JS_PUBLIC_API(bool)
JS_DefineUCProperty(JSContext* cx, JS::HandleObject obj, const char16_t* name, size_t namelen,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::ObjectOpResult& result);
extern JS_PUBLIC_API(bool)
JS_DefineUCProperty(JSContext* cx, JS::HandleObject obj, const char16_t* name, size_t namelen,
JS::Handle<JSPropertyDescriptor> desc);
JS::Handle<JS::PropertyDescriptor> desc);
extern JS_PUBLIC_API(bool)
JS_DefineUCProperty(JSContext* cx, JS::HandleObject obj, const char16_t* name, size_t namelen,

View File

@ -134,7 +134,7 @@ class CompartmentChecker
void check(AbstractFramePtr frame);
void check(SavedStacks* stacks);
void check(Handle<JSPropertyDescriptor> desc) {
void check(Handle<PropertyDescriptor> desc) {
check(desc.object());
if (desc.hasGetterObject())
check(desc.getterObject());

View File

@ -282,7 +282,7 @@ JS_CopyPropertyFrom(JSContext* cx, JS::HandleId id, JS::HandleObject target,
PropertyCopyBehavior copyBehavior = CopyNonConfigurableAsIs);
extern JS_FRIEND_API(bool)
JS_WrapPropertyDescriptor(JSContext* cx, JS::MutableHandle<JSPropertyDescriptor> desc);
JS_WrapPropertyDescriptor(JSContext* cx, JS::MutableHandle<JS::PropertyDescriptor> desc);
struct JSFunctionSpecWithHelp {
const char* name;
@ -374,7 +374,7 @@ proxy_LookupProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::M
JS::MutableHandle<Shape*> propp);
extern JS_FRIEND_API(bool)
proxy_DefineProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::ObjectOpResult& result);
extern JS_FRIEND_API(bool)
proxy_HasProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool* foundp);
@ -386,7 +386,7 @@ proxy_SetProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::Hand
JS::HandleValue receiver, JS::ObjectOpResult& result);
extern JS_FRIEND_API(bool)
proxy_GetOwnPropertyDescriptor(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
extern JS_FRIEND_API(bool)
proxy_DeleteProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::ObjectOpResult& result);
@ -2719,7 +2719,7 @@ ForwardToNative(JSContext* cx, JSNative native, const JS::CallArgs& args);
JS_FRIEND_API(bool)
SetPropertyIgnoringNamedGetter(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
JS::HandleValue v, JS::HandleValue receiver,
JS::Handle<JSPropertyDescriptor> ownDesc,
JS::Handle<JS::PropertyDescriptor> ownDesc,
JS::ObjectOpResult& result);
JS_FRIEND_API(void)

View File

@ -1062,7 +1062,7 @@ JS_CopyPropertyFrom(JSContext* cx, HandleId id, HandleObject target,
{
// |obj| and |cx| are generally not same-compartment with |target| here.
assertSameCompartment(cx, obj, id);
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!GetOwnPropertyDescriptor(cx, obj, id, &desc))
return false;

View File

@ -97,7 +97,6 @@ struct JSFunctionSpec;
struct JSLocaleCallbacks;
struct JSObjectMap;
struct JSPrincipals;
struct JSPropertyDescriptor;
struct JSPropertyName;
struct JSPropertySpec;
struct JSRuntime;
@ -138,6 +137,8 @@ void FinishPersistentRootedChains(js::RootLists&);
namespace JS {
struct PropertyDescriptor;
typedef void (*OffThreadCompileCallback)(void* token, void* callbackData);
enum class HeapState {

View File

@ -110,9 +110,9 @@ class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper
/* Standard internal methods. */
virtual bool getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const override;
virtual bool ownPropertyKeys(JSContext* cx, HandleObject wrapper,
AutoIdVector& props) const override;
@ -139,7 +139,7 @@ class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper
/* SpiderMonkey extensions. */
virtual bool getPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool hasOwn(JSContext* cx, HandleObject wrapper, HandleId id, bool* bp) const override;
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject wrapper,
AutoIdVector& props) const override;
@ -165,9 +165,9 @@ class JS_FRIEND_API(OpaqueCrossCompartmentWrapper) : public CrossCompartmentWrap
/* Standard internal methods. */
virtual bool getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const override;
virtual bool ownPropertyKeys(JSContext* cx, HandleObject wrapper,
AutoIdVector& props) const override;
@ -195,7 +195,7 @@ class JS_FRIEND_API(OpaqueCrossCompartmentWrapper) : public CrossCompartmentWrap
/* SpiderMonkey extensions. */
virtual bool getPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool hasOwn(JSContext* cx, HandleObject wrapper, HandleId id,
bool* bp) const override;
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject wrapper,
@ -231,7 +231,7 @@ class JS_FRIEND_API(SecurityWrapper) : public Base
bool* bp) const override;
virtual bool defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const override;
virtual bool isExtensible(JSContext* cx, HandleObject wrapper, bool* extensible) const override;
virtual bool preventExtensions(JSContext* cx, HandleObject wrapper,

View File

@ -20,9 +20,9 @@ class DeadObjectProxy : public BaseProxyHandler
/* Standard internal methods. */
virtual bool getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const override;
virtual bool ownPropertyKeys(JSContext* cx, HandleObject wrapper,
AutoIdVector& props) const override;

View File

@ -22,7 +22,7 @@ OpaqueCrossCompartmentWrapper::getOwnPropertyDescriptor(JSContext* cx,
bool
OpaqueCrossCompartmentWrapper::defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const
{
return result.succeed();
@ -131,7 +131,7 @@ bool
OpaqueCrossCompartmentWrapper::getPropertyDescriptor(JSContext* cx,
HandleObject wrapper,
HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const
MutableHandle<PropertyDescriptor> desc) const
{
return BaseProxyHandler::getPropertyDescriptor(cx, wrapper, id, desc);
}

View File

@ -553,7 +553,7 @@ js::proxy_LookupProperty(JSContext* cx, HandleObject obj, HandleId id,
bool
js::proxy_DefineProperty(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result)
{
return Proxy::defineProperty(cx, obj, id, desc, result);
@ -581,7 +581,7 @@ js::proxy_SetProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue
bool
js::proxy_GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
return Proxy::getOwnPropertyDescriptor(cx, obj, id, desc);
}

View File

@ -27,9 +27,9 @@ class Proxy
public:
/* Standard internal methods. */
static bool getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc);
MutableHandle<PropertyDescriptor> desc);
static bool defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc, ObjectOpResult& result);
Handle<PropertyDescriptor> desc, ObjectOpResult& result);
static bool ownPropertyKeys(JSContext* cx, HandleObject proxy, AutoIdVector& props);
static bool delete_(JSContext* cx, HandleObject proxy, HandleId id, ObjectOpResult& result);
static bool enumerate(JSContext* cx, HandleObject proxy, MutableHandleObject objp);
@ -49,7 +49,7 @@ class Proxy
/* SpiderMonkey extensions. */
static bool getPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc);
MutableHandle<PropertyDescriptor> desc);
static bool hasOwn(JSContext* cx, HandleObject proxy, HandleId id, bool* bp);
static bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props);

View File

@ -20,9 +20,9 @@ class ScriptedDirectProxyHandler : public BaseProxyHandler {
/* Standard internal methods. */
virtual bool getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const override;
virtual bool ownPropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props) const override;

View File

@ -21,9 +21,9 @@ class ScriptedIndirectProxyHandler : public BaseProxyHandler
/* Standard internal methods. */
virtual bool getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const override;
virtual bool ownPropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props) const override;
@ -42,7 +42,7 @@ class ScriptedIndirectProxyHandler : public BaseProxyHandler
/* SpiderMonkey extensions. */
virtual bool getPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<JSPropertyDescriptor> desc) const override;
MutableHandle<PropertyDescriptor> desc) const override;
virtual bool hasOwn(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const override;
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy,
AutoIdVector& props) const override;

View File

@ -620,7 +620,7 @@ ModuleEnvironmentObject::setProperty(JSContext* cx, HandleObject obj, HandleId i
/* static */ bool
ModuleEnvironmentObject::getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
// We never call this hook on scope objects.
MOZ_CRASH();
@ -799,7 +799,7 @@ with_SetProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v,
static bool
with_GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
MOZ_ASSERT(!JSID_IS_ATOM(id, cx->names().dotThis));
RootedObject actual(cx, &obj->as<DynamicWithObject>().object());
@ -1326,7 +1326,7 @@ lexicalError_SetProperty(JSContext* cx, HandleObject obj, HandleId id, HandleVal
static bool
lexicalError_GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
ReportRuntimeLexicalErrorId(cx, obj->as<RuntimeLexicalErrorObject>().errorNumber(), id);
return false;

View File

@ -807,7 +807,7 @@ class ModuleEnvironmentObject : public LexicalScopeBase
static bool setProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v,
HandleValue receiver, JS::ObjectOpResult& result);
static bool getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc);
MutableHandle<PropertyDescriptor> desc);
static bool deleteProperty(JSContext* cx, HandleObject obj, HandleId id,
ObjectOpResult& result);
static bool enumerate(JSContext* cx, HandleObject obj, AutoIdVector& properties,

View File

@ -115,7 +115,6 @@ class TenuringTracer;
typedef JSGetterOp GetterOp;
typedef JSSetterOp SetterOp;
typedef JSPropertyDescriptor PropertyDescriptor;
/* Limit on the number of slotful properties in an object. */
static const uint32_t SHAPE_INVALID_SLOT = JS_BIT(24) - 1;

View File

@ -740,7 +740,7 @@ UnboxedPlainObject::obj_lookupProperty(JSContext* cx, HandleObject obj,
/* static */ bool
UnboxedPlainObject::obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result)
{
const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
@ -849,7 +849,7 @@ UnboxedPlainObject::obj_setProperty(JSContext* cx, HandleObject obj, HandleId id
/* static */ bool
UnboxedPlainObject::obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
@ -1433,7 +1433,7 @@ UnboxedArrayObject::obj_lookupProperty(JSContext* cx, HandleObject obj,
/* static */ bool
UnboxedArrayObject::obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result)
{
if (JSID_IS_INT(id) && !desc.getter() && !desc.setter() && desc.attributes() == JSPROP_ENUMERATE) {
@ -1537,7 +1537,7 @@ UnboxedArrayObject::obj_setProperty(JSContext* cx, HandleObject obj, HandleId id
/* static */ bool
UnboxedArrayObject::obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
if (obj->as<UnboxedArrayObject>().containsProperty(cx, id)) {
if (JSID_IS_INT(id)) {

View File

@ -245,7 +245,7 @@ class UnboxedPlainObject : public JSObject
MutableHandleShape propp);
static bool obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result);
static bool obj_hasProperty(JSContext* cx, HandleObject obj, HandleId id, bool* foundp);
@ -257,7 +257,7 @@ class UnboxedPlainObject : public JSObject
HandleValue receiver, ObjectOpResult& result);
static bool obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc);
MutableHandle<PropertyDescriptor> desc);
static bool obj_deleteProperty(JSContext* cx, HandleObject obj, HandleId id,
ObjectOpResult& result);
@ -381,7 +381,7 @@ class UnboxedArrayObject : public JSObject
MutableHandleShape propp);
static bool obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result);
static bool obj_hasProperty(JSContext* cx, HandleObject obj, HandleId id, bool* foundp);
@ -393,7 +393,7 @@ class UnboxedArrayObject : public JSObject
HandleValue receiver, ObjectOpResult& result);
static bool obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<JSPropertyDescriptor> desc);
MutableHandle<PropertyDescriptor> desc);
static bool obj_deleteProperty(JSContext* cx, HandleObject obj, HandleId id,
ObjectOpResult& result);

View File

@ -511,7 +511,7 @@ sandbox_addProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v)
// After bug 1015790 is fixed, we should be able to remove this unwrapping.
RootedObject unwrappedProto(cx, js::UncheckedUnwrap(proto, /* stopAtWindowProxy = */ false));
Rooted<JSPropertyDescriptor> pd(cx);
Rooted<JS::PropertyDescriptor> pd(cx);
if (!JS_GetPropertyDescriptorById(cx, proto, id, &pd))
return false;
@ -725,7 +725,7 @@ WrapCallable(JSContext* cx, HandleObject callable, HandleObject sandboxProtoProx
}
template<typename Op>
bool WrapAccessorFunction(JSContext* cx, Op& op, JSPropertyDescriptor* desc,
bool WrapAccessorFunction(JSContext* cx, Op& op, PropertyDescriptor* desc,
unsigned attrFlag, HandleObject sandboxProtoProxy)
{
if (!op) {
@ -749,7 +749,7 @@ bool
xpc::SandboxProxyHandler::getPropertyDescriptor(JSContext* cx,
JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const
JS::MutableHandle<PropertyDescriptor> desc) const
{
JS::RootedObject obj(cx, wrappedObject(proxy));
@ -784,7 +784,7 @@ bool
xpc::SandboxProxyHandler::getOwnPropertyDescriptor(JSContext* cx,
JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc)
JS::MutableHandle<PropertyDescriptor> desc)
const
{
if (!getPropertyDescriptor(cx, proxy, id, desc))

View File

@ -398,7 +398,7 @@ DefinePropertyIfFound(XPCCallContext& ccx,
}
if (scope->HasInterposition()) {
Rooted<JSPropertyDescriptor> desc(ccx);
Rooted<PropertyDescriptor> desc(ccx);
if (!xpc::InterposeProperty(ccx, obj, iface->GetIID(), id, &desc))
return false;

View File

@ -328,7 +328,7 @@ ExposedPropertiesOnly::check(JSContext* cx, HandleObject wrapper, HandleId id, W
if (id == JSID_VOID)
return true;
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!JS_GetPropertyDescriptorById(cx, wrappedObject, exposedPropsId, &desc))
return false;

View File

@ -25,7 +25,7 @@ namespace xpc {
bool
InterposeProperty(JSContext* cx, HandleObject target, const nsIID* iid, HandleId id,
MutableHandle<JSPropertyDescriptor> descriptor)
MutableHandle<PropertyDescriptor> descriptor)
{
// We only want to do interpostion on DOM instances and
// wrapped natives.
@ -144,7 +144,7 @@ bool AddonWrapper<Base>::call(JSContext* cx, JS::Handle<JSObject*> wrapper,
template<typename Base>
bool
AddonWrapper<Base>::getPropertyDescriptor(JSContext* cx, HandleObject wrapper,
HandleId id, MutableHandle<JSPropertyDescriptor> desc) const
HandleId id, MutableHandle<PropertyDescriptor> desc) const
{
if (!InterposeProperty(cx, wrapper, nullptr, id, desc))
return false;
@ -158,7 +158,7 @@ AddonWrapper<Base>::getPropertyDescriptor(JSContext* cx, HandleObject wrapper,
template<typename Base>
bool
AddonWrapper<Base>::getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper,
HandleId id, MutableHandle<JSPropertyDescriptor> desc) const
HandleId id, MutableHandle<PropertyDescriptor> desc) const
{
if (!InterposeProperty(cx, wrapper, nullptr, id, desc))
return false;
@ -176,7 +176,7 @@ AddonWrapper<Base>::get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle
{
PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER);
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!InterposeProperty(cx, wrapper, nullptr, id, &desc))
return false;
@ -196,7 +196,7 @@ bool
AddonWrapper<Base>::set(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id, JS::HandleValue v,
JS::HandleValue receiver, JS::ObjectOpResult& result) const
{
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!InterposeProperty(cx, wrapper, nullptr, id, &desc))
return false;
@ -221,10 +221,10 @@ AddonWrapper<Base>::set(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id
template<typename Base>
bool
AddonWrapper<Base>::defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const
{
Rooted<JSPropertyDescriptor> interpDesc(cx);
Rooted<PropertyDescriptor> interpDesc(cx);
if (!InterposeProperty(cx, wrapper, nullptr, id, &interpDesc))
return false;
@ -240,7 +240,7 @@ bool
AddonWrapper<Base>::delete_(JSContext* cx, HandleObject wrapper, HandleId id,
ObjectOpResult& result) const
{
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!InterposeProperty(cx, wrapper, nullptr, id, &desc))
return false;

View File

@ -17,7 +17,7 @@ namespace xpc {
bool
InterposeProperty(JSContext* cx, JS::HandleObject target, const nsIID* iid, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> descriptor);
JS::MutableHandle<JS::PropertyDescriptor> descriptor);
bool
InterposeCall(JSContext* cx, JS::HandleObject wrapper,
@ -30,9 +30,9 @@ class AddonWrapper : public Base {
virtual bool getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::ObjectOpResult& result) const override;
virtual bool delete_(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
JS::ObjectOpResult& result) const override;
@ -45,7 +45,7 @@ class AddonWrapper : public Base {
virtual bool getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
static const AddonWrapper singleton;
};

View File

@ -21,8 +21,8 @@ const ChromeObjectWrapper ChromeObjectWrapper::singleton;
bool
ChromeObjectWrapper::defineProperty(JSContext* cx, HandleObject wrapper,
HandleId id,
Handle<JSPropertyDescriptor> desc,
JS::ObjectOpResult& result) const
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const
{
if (!AccessCheck::checkPassToPrivilegedCode(cx, wrapper, desc.value()))
return false;

View File

@ -29,7 +29,7 @@ class ChromeObjectWrapper : public ChromeObjectWrapperBase
virtual bool defineProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::ObjectOpResult& result) const override;
virtual bool set(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id,
JS::HandleValue v, JS::HandleValue receiver,

View File

@ -35,7 +35,7 @@ Filter(JSContext* cx, HandleObject wrapper, AutoIdVector& props)
template <typename Policy>
static bool
FilterPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc)
FilterPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id, MutableHandle<PropertyDescriptor> desc)
{
MOZ_ASSERT(!JS_IsExceptionPending(cx));
bool getAllowed = Policy::check(cx, wrapper, id, Wrapper::GET);
@ -68,7 +68,7 @@ template <typename Base, typename Policy>
bool
FilteringWrapper<Base, Policy>::getPropertyDescriptor(JSContext* cx, HandleObject wrapper,
HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) const
MutableHandle<PropertyDescriptor> desc) const
{
assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::GET | BaseProxyHandler::SET |
BaseProxyHandler::GET_PROPERTY_DESCRIPTOR);
@ -81,7 +81,7 @@ template <typename Base, typename Policy>
bool
FilteringWrapper<Base, Policy>::getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper,
HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) const
MutableHandle<PropertyDescriptor> desc) const
{
assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::GET | BaseProxyHandler::SET |
BaseProxyHandler::GET_PROPERTY_DESCRIPTOR);
@ -185,7 +185,7 @@ bool
CrossOriginXrayWrapper::getPropertyDescriptor(JSContext* cx,
JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const
JS::MutableHandle<PropertyDescriptor> desc) const
{
if (!SecurityXrayDOM::getPropertyDescriptor(cx, wrapper, id, desc))
return false;
@ -207,7 +207,7 @@ bool
CrossOriginXrayWrapper::getOwnPropertyDescriptor(JSContext* cx,
JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const
JS::MutableHandle<PropertyDescriptor> desc) const
{
// All properties on cross-origin DOM objects are |own|.
return getPropertyDescriptor(cx, wrapper, id, desc);
@ -226,7 +226,7 @@ CrossOriginXrayWrapper::ownPropertyKeys(JSContext* cx, JS::Handle<JSObject*> wra
bool
CrossOriginXrayWrapper::defineProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<PropertyDescriptor> desc,
JS::ObjectOpResult& result) const
{
JS_ReportError(cx, "Permission denied to define property on cross-origin object");

View File

@ -12,8 +12,6 @@
#include "jswrapper.h"
#include "js/CallNonGenericMethod.h"
struct JSPropertyDescriptor;
namespace JS {
template <typename T>
class AutoVectorRooter;
@ -32,13 +30,13 @@ class FilteringWrapper : public Base {
virtual bool getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
virtual bool ownPropertyKeys(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::AutoIdVector& props) const override;
virtual bool getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::AutoIdVector& props) const override;
virtual bool enumerate(JSContext* cx, JS::Handle<JSObject*> wrapper,
@ -69,10 +67,10 @@ class CrossOriginXrayWrapper : public SecurityXrayDOM {
virtual bool getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::ObjectOpResult& result) const override;
virtual bool ownPropertyKeys(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::AutoIdVector& props) const override;
@ -81,7 +79,7 @@ class CrossOriginXrayWrapper : public SecurityXrayDOM {
virtual bool getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
};
} // namespace xpc

View File

@ -13,7 +13,7 @@ using namespace JS;
namespace xpc {
static bool
WaiveAccessors(JSContext* cx, JS::MutableHandle<JSPropertyDescriptor> desc)
WaiveAccessors(JSContext* cx, MutableHandle<PropertyDescriptor> desc)
{
if (desc.hasGetterObject() && desc.getterObject()) {
RootedValue v(cx, JS::ObjectValue(*desc.getterObject()));
@ -32,18 +32,16 @@ WaiveAccessors(JSContext* cx, JS::MutableHandle<JSPropertyDescriptor> desc)
}
bool
WaiveXrayWrapper::getPropertyDescriptor(JSContext* cx, HandleObject wrapper,
HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc)
const
WaiveXrayWrapper::getPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id,
MutableHandle<PropertyDescriptor> desc) const
{
return CrossCompartmentWrapper::getPropertyDescriptor(cx, wrapper, id, desc) &&
WrapperFactory::WaiveXrayAndWrap(cx, desc.value()) && WaiveAccessors(cx, desc);
}
bool
WaiveXrayWrapper::getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper,
HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc)
const
WaiveXrayWrapper::getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id,
MutableHandle<PropertyDescriptor> desc) const
{
return CrossCompartmentWrapper::getOwnPropertyDescriptor(cx, wrapper, id, desc) &&
WrapperFactory::WaiveXrayAndWrap(cx, desc.value()) && WaiveAccessors(cx, desc);

View File

@ -19,7 +19,7 @@ class WaiveXrayWrapper : public js::CrossCompartmentWrapper {
virtual bool getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
virtual bool getPrototype(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::MutableHandle<JSObject*> protop) const override;
virtual bool get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<JS::Value> receiver,
@ -35,7 +35,7 @@ class WaiveXrayWrapper : public js::CrossCompartmentWrapper {
JS::NativeImpl impl, const JS::CallArgs& args) const override;
virtual bool getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
static const WaiveXrayWrapper singleton;
};

View File

@ -173,7 +173,7 @@ const JSClass JSXrayTraits::HolderClass = {
bool
OpaqueXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper, HandleObject wrapper,
HandleObject holder, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
bool ok = XrayTraits::resolveOwnProperty(cx, jsWrapper, wrapper, holder, id, desc);
if (!ok || desc.object())
@ -273,7 +273,7 @@ ReportWrapperDenial(JSContext* cx, HandleId id, WrapperDenialType type, const ch
bool JSXrayTraits::getOwnPropertyFromWrapperIfSafe(JSContext* cx,
HandleObject wrapper,
HandleId id,
MutableHandle<JSPropertyDescriptor> outDesc)
MutableHandle<PropertyDescriptor> outDesc)
{
MOZ_ASSERT(js::IsObjectInContextCompartment(wrapper, cx));
RootedObject target(cx, getTargetObject(wrapper));
@ -289,7 +289,7 @@ bool JSXrayTraits::getOwnPropertyFromTargetIfSafe(JSContext* cx,
HandleObject target,
HandleObject wrapper,
HandleId id,
MutableHandle<JSPropertyDescriptor> outDesc)
MutableHandle<PropertyDescriptor> outDesc)
{
// Note - This function operates in the target compartment, because it
// avoids a bunch of back-and-forth wrapping in enumerateNames.
@ -298,7 +298,7 @@ bool JSXrayTraits::getOwnPropertyFromTargetIfSafe(JSContext* cx,
MOZ_ASSERT(WrapperFactory::IsXrayWrapper(wrapper));
MOZ_ASSERT(outDesc.object() == nullptr);
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!JS_GetOwnPropertyDescriptorById(cx, target, id, &desc))
return false;
@ -377,7 +377,7 @@ bool
JSXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
HandleObject wrapper, HandleObject holder,
HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
// Call the common code.
bool ok = XrayTraits::resolveOwnProperty(cx, jsWrapper, wrapper, holder,
@ -405,7 +405,7 @@ JSXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
// WebExtensions can't use cloneInto(), so we just let them do
// the slow thing to maximize compatibility.
if (CompartmentPrivate::Get(CurrentGlobalOrNull(cx))->isWebExtensionContentScript) {
Rooted<JSPropertyDescriptor> innerDesc(cx);
Rooted<PropertyDescriptor> innerDesc(cx);
{
JSAutoCompartment ac(cx, target);
if (!JS_GetOwnPropertyDescriptorById(cx, target, id, &innerDesc))
@ -625,7 +625,7 @@ JSXrayTraits::delete_(JSContext* cx, HandleObject wrapper, HandleId id, ObjectOp
if (isObjectOrArrayInstance) {
RootedObject target(cx, getTargetObject(wrapper));
JSAutoCompartment ac(cx, target);
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
if (!getOwnPropertyFromTargetIfSafe(cx, target, wrapper, id, &desc))
return false;
if (desc.object())
@ -636,8 +636,8 @@ JSXrayTraits::delete_(JSContext* cx, HandleObject wrapper, HandleId id, ObjectOp
bool
JSXrayTraits::defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<JSPropertyDescriptor> existingDesc,
Handle<PropertyDescriptor> desc,
Handle<PropertyDescriptor> existingDesc,
ObjectOpResult& result,
bool* defined)
{
@ -680,7 +680,7 @@ JSXrayTraits::defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
return false;
}
Rooted<JSPropertyDescriptor> wrappedDesc(cx, desc);
Rooted<PropertyDescriptor> wrappedDesc(cx, desc);
JSAutoCompartment ac(cx, target);
if (!JS_WrapPropertyDescriptor(cx, &wrappedDesc) ||
!JS_DefinePropertyById(cx, target, id, wrappedDesc, result))
@ -743,7 +743,7 @@ JSXrayTraits::enumerateNames(JSContext* cx, HandleObject wrapper, unsigned flags
if (!props.reserve(targetProps.length()))
return false;
for (size_t i = 0; i < targetProps.length(); ++i) {
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
RootedId id(cx, targetProps[i]);
if (!getOwnPropertyFromTargetIfSafe(cx, target, wrapper, id, &desc))
return false;
@ -1200,7 +1200,7 @@ XrayToString(JSContext* cx, unsigned argc, JS::Value* vp);
bool
XPCWrappedNativeXrayTraits::resolveNativeProperty(JSContext* cx, HandleObject wrapper,
HandleObject holder, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
MOZ_ASSERT(js::GetObjectJSClass(holder) == &HolderClass);
@ -1362,7 +1362,7 @@ wrappedJSObject_getter(JSContext* cx, unsigned argc, Value* vp)
bool
XrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
HandleObject wrapper, HandleObject holder, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
desc.object().set(nullptr);
RootedObject target(cx, getTargetObject(wrapper));
@ -1434,7 +1434,7 @@ bool
XPCWrappedNativeXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
HandleObject wrapper, HandleObject holder,
HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
// Call the common code.
bool ok = XrayTraits::resolveOwnProperty(cx, jsWrapper, wrapper, holder,
@ -1473,8 +1473,8 @@ XPCWrappedNativeXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsW
bool
XPCWrappedNativeXrayTraits::defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<JSPropertyDescriptor> existingDesc,
Handle<PropertyDescriptor> desc,
Handle<PropertyDescriptor> existingDesc,
JS::ObjectOpResult& result, bool* defined)
{
*defined = false;
@ -1581,7 +1581,7 @@ XPCWrappedNativeXrayTraits::construct(JSContext* cx, HandleObject wrapper,
bool
DOMXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper, HandleObject wrapper,
HandleObject holder, HandleId id,
MutableHandle<JSPropertyDescriptor> desc)
MutableHandle<PropertyDescriptor> desc)
{
// Call the common code.
bool ok = XrayTraits::resolveOwnProperty(cx, jsWrapper, wrapper, holder, id, desc);
@ -1633,8 +1633,8 @@ DOMXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper, Handl
bool
DOMXrayTraits::defineProperty(JSContext* cx, HandleObject wrapper, HandleId id,
Handle<JSPropertyDescriptor> desc,
Handle<JSPropertyDescriptor> existingDesc,
Handle<PropertyDescriptor> desc,
Handle<PropertyDescriptor> existingDesc,
JS::ObjectOpResult& result, bool* defined)
{
// Check for an indexed property on a Window. If that's happening, do
@ -1762,7 +1762,7 @@ HasNativeProperty(JSContext* cx, HandleObject wrapper, HandleId id, bool* hasPro
RootedObject holder(cx, traits->ensureHolder(cx, wrapper));
NS_ENSURE_TRUE(holder, false);
*hasProp = false;
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
const Wrapper* handler = Wrapper::wrapperHandler(wrapper);
// Try resolveOwnProperty.
@ -1870,7 +1870,7 @@ XrayWrapper<Base, Traits>::isExtensible(JSContext* cx, JS::Handle<JSObject*> wra
template <typename Base, typename Traits>
bool
XrayWrapper<Base, Traits>::getPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc)
JS::MutableHandle<PropertyDescriptor> desc)
const
{
assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::GET | BaseProxyHandler::SET |
@ -1958,7 +1958,7 @@ XrayWrapper<Base, Traits>::getPropertyDescriptor(JSContext* cx, HandleObject wra
template <typename Base, typename Traits>
bool
XrayWrapper<Base, Traits>::getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper, HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc)
JS::MutableHandle<PropertyDescriptor> desc)
const
{
assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::GET | BaseProxyHandler::SET |
@ -1987,8 +1987,8 @@ XrayWrapper<Base, Traits>::getOwnPropertyDescriptor(JSContext* cx, HandleObject
// to the content object. This is ok, because the the expando object is only
// ever accessed by code across the compartment boundary.
static bool
RecreateLostWaivers(JSContext* cx, const JSPropertyDescriptor* orig,
MutableHandle<JSPropertyDescriptor> wrapped)
RecreateLostWaivers(JSContext* cx, const PropertyDescriptor* orig,
MutableHandle<PropertyDescriptor> wrapped)
{
// Compute whether the original objects were waived, and implicitly, whether
// they were objects at all.
@ -2032,12 +2032,12 @@ RecreateLostWaivers(JSContext* cx, const JSPropertyDescriptor* orig,
template <typename Base, typename Traits>
bool
XrayWrapper<Base, Traits>::defineProperty(JSContext* cx, HandleObject wrapper,
HandleId id, Handle<JSPropertyDescriptor> desc,
HandleId id, Handle<PropertyDescriptor> desc,
ObjectOpResult& result) const
{
assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::SET);
Rooted<JSPropertyDescriptor> existing_desc(cx);
Rooted<PropertyDescriptor> existing_desc(cx);
if (!JS_GetPropertyDescriptorById(cx, wrapper, id, &existing_desc))
return false;
@ -2082,7 +2082,7 @@ XrayWrapper<Base, Traits>::defineProperty(JSContext* cx, HandleObject wrapper,
return false;
// Wrap the property descriptor for the target compartment.
Rooted<JSPropertyDescriptor> wrappedDesc(cx, desc);
Rooted<PropertyDescriptor> wrappedDesc(cx, desc);
if (!JS_WrapPropertyDescriptor(cx, &wrappedDesc))
return false;

View File

@ -69,14 +69,14 @@ public:
virtual bool resolveNativeProperty(JSContext* cx, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) = 0;
JS::MutableHandle<JS::PropertyDescriptor> desc) = 0;
// NB: resolveOwnProperty may decide whether or not to cache what it finds
// on the holder. If the result is not cached, the lookup will happen afresh
// for each access, which is the right thing for things like dynamic NodeList
// properties.
virtual bool resolveOwnProperty(JSContext* cx, const js::Wrapper& jsWrapper,
JS::HandleObject wrapper, JS::HandleObject holder,
JS::HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc);
JS::HandleId id, JS::MutableHandle<JS::PropertyDescriptor> desc);
bool delete_(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id,
JS::ObjectOpResult& result) {
@ -128,13 +128,13 @@ public:
virtual bool resolveNativeProperty(JSContext* cx, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) override;
JS::MutableHandle<JS::PropertyDescriptor> desc) override;
virtual bool resolveOwnProperty(JSContext* cx, const js::Wrapper& jsWrapper, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) override;
JS::MutableHandle<JS::PropertyDescriptor> desc) override;
bool defineProperty(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JSPropertyDescriptor> existingDesc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> existingDesc,
JS::ObjectOpResult& result, bool* defined);
virtual bool enumerateNames(JSContext* cx, JS::HandleObject wrapper, unsigned flags,
JS::AutoIdVector& props);
@ -145,7 +145,7 @@ public:
static bool resolveDOMCollectionProperty(JSContext* cx, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
static XPCWrappedNative* getWN(JSObject* wrapper);
@ -168,7 +168,7 @@ public:
virtual bool resolveNativeProperty(JSContext* cx, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) override
JS::MutableHandle<JS::PropertyDescriptor> desc) override
{
// Xrays for DOM binding objects have a prototype chain that consists of
// Xrays for the prototypes of the DOM binding object (ignoring changes
@ -183,10 +183,10 @@ public:
}
virtual bool resolveOwnProperty(JSContext* cx, const js::Wrapper& jsWrapper, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) override;
JS::MutableHandle<JS::PropertyDescriptor> desc) override;
bool defineProperty(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JSPropertyDescriptor> existingDesc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> existingDesc,
JS::ObjectOpResult& result, bool* defined);
virtual bool enumerateNames(JSContext* cx, JS::HandleObject wrapper, unsigned flags,
JS::AutoIdVector& props);
@ -216,20 +216,20 @@ public:
virtual bool resolveNativeProperty(JSContext* cx, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) override
JS::MutableHandle<JS::PropertyDescriptor> desc) override
{
MOZ_CRASH("resolveNativeProperty hook should never be called with HasPrototype = 1");
}
virtual bool resolveOwnProperty(JSContext* cx, const js::Wrapper& jsWrapper, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) override;
JS::MutableHandle<JS::PropertyDescriptor> desc) override;
bool delete_(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id, JS::ObjectOpResult& result);
bool defineProperty(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JSPropertyDescriptor> existingDesc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> existingDesc,
JS::ObjectOpResult& result, bool* defined);
virtual bool enumerateNames(JSContext* cx, JS::HandleObject wrapper, unsigned flags,
@ -317,14 +317,14 @@ public:
static bool getOwnPropertyFromWrapperIfSafe(JSContext* cx,
JS::HandleObject wrapper,
JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
// Like the above, but operates in the target compartment.
static bool getOwnPropertyFromTargetIfSafe(JSContext* cx,
JS::HandleObject target,
JS::HandleObject wrapper,
JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
JS::MutableHandle<JS::PropertyDescriptor> desc);
static const JSClass HolderClass;
static JSXrayTraits singleton;
@ -343,18 +343,18 @@ public:
virtual bool resolveNativeProperty(JSContext* cx, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) override
JS::MutableHandle<JS::PropertyDescriptor> desc) override
{
MOZ_CRASH("resolveNativeProperty hook should never be called with HasPrototype = 1");
}
virtual bool resolveOwnProperty(JSContext* cx, const js::Wrapper& jsWrapper, JS::HandleObject wrapper,
JS::HandleObject holder, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc) override;
JS::MutableHandle<JS::PropertyDescriptor> desc) override;
bool defineProperty(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JSPropertyDescriptor> existingDesc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> existingDesc,
JS::ObjectOpResult& result, bool* defined)
{
*defined = false;
@ -425,9 +425,9 @@ class XrayWrapper : public Base {
/* Standard internal methods. */
virtual bool getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
virtual bool defineProperty(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
JS::Handle<JSPropertyDescriptor> desc,
JS::Handle<JS::PropertyDescriptor> desc,
JS::ObjectOpResult& result) const override;
virtual bool ownPropertyKeys(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::AutoIdVector& props) const override;
@ -458,7 +458,7 @@ class XrayWrapper : public Base {
/* SpiderMonkey extensions. */
virtual bool getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
virtual bool hasOwn(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
bool* bp) const override;
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::Handle<JSObject*> wrapper,
@ -511,7 +511,7 @@ public:
virtual bool getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
// We just forward the high-level methods to the BaseProxyHandler versions
// which implement them in terms of lower-level methods.
@ -525,7 +525,7 @@ public:
virtual bool getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
virtual bool hasOwn(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
bool* bp) const override;
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::Handle<JSObject*> proxy,