Bug 603201 - Change GetProperty receiver argument to Value in the browser. r=smaug
This commit is contained in:
@@ -635,7 +635,7 @@ public:
|
|||||||
virtual bool has(JSContext *cx, JS::Handle<JSObject*> proxy,
|
virtual bool has(JSContext *cx, JS::Handle<JSObject*> proxy,
|
||||||
JS::Handle<jsid> id, bool *bp) const override;
|
JS::Handle<jsid> id, bool *bp) const override;
|
||||||
virtual bool get(JSContext *cx, JS::Handle<JSObject*> proxy,
|
virtual bool get(JSContext *cx, JS::Handle<JSObject*> proxy,
|
||||||
JS::Handle<JSObject*> receiver,
|
JS::Handle<JS::Value> receiver,
|
||||||
JS::Handle<jsid> id,
|
JS::Handle<jsid> id,
|
||||||
JS::MutableHandle<JS::Value> vp) const override;
|
JS::MutableHandle<JS::Value> vp) const override;
|
||||||
virtual bool set(JSContext *cx, JS::Handle<JSObject*> proxy,
|
virtual bool set(JSContext *cx, JS::Handle<JSObject*> proxy,
|
||||||
@@ -900,7 +900,7 @@ nsOuterWindowProxy::hasOwn(JSContext *cx, JS::Handle<JSObject*> proxy,
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
nsOuterWindowProxy::get(JSContext *cx, JS::Handle<JSObject*> proxy,
|
nsOuterWindowProxy::get(JSContext *cx, JS::Handle<JSObject*> proxy,
|
||||||
JS::Handle<JSObject*> receiver,
|
JS::Handle<JS::Value> receiver,
|
||||||
JS::Handle<jsid> id,
|
JS::Handle<jsid> id,
|
||||||
JS::MutableHandle<JS::Value> vp) const
|
JS::MutableHandle<JS::Value> vp) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1699,8 +1699,8 @@ NativePropertyHooks sEmptyNativePropertyHooks = {
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
GetPropertyOnPrototype(JSContext* cx, JS::Handle<JSObject*> proxy,
|
GetPropertyOnPrototype(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||||
JS::Handle<jsid> id, bool* found,
|
JS::Handle<JS::Value> receiver, JS::Handle<jsid> id,
|
||||||
JS::MutableHandle<JS::Value> vp)
|
bool* found, JS::MutableHandle<JS::Value> vp)
|
||||||
{
|
{
|
||||||
JS::Rooted<JSObject*> proto(cx);
|
JS::Rooted<JSObject*> proto(cx);
|
||||||
if (!js::GetObjectProto(cx, proxy, &proto)) {
|
if (!js::GetObjectProto(cx, proxy, &proto)) {
|
||||||
@@ -1719,7 +1719,7 @@ GetPropertyOnPrototype(JSContext* cx, JS::Handle<JSObject*> proxy,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return JS_ForwardGetPropertyTo(cx, proto, id, proxy, vp);
|
return JS_ForwardGetPropertyTo(cx, proto, id, receiver, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -1847,8 +1847,8 @@ ThrowConstructorWithoutNew(JSContext* cx, const char* name);
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
GetPropertyOnPrototype(JSContext* cx, JS::Handle<JSObject*> proxy,
|
GetPropertyOnPrototype(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||||
JS::Handle<jsid> id, bool* found,
|
JS::Handle<JS::Value> receiver, JS::Handle<jsid> id,
|
||||||
JS::MutableHandle<JS::Value> vp);
|
bool* found, JS::MutableHandle<JS::Value> vp);
|
||||||
|
|
||||||
//
|
//
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -11039,7 +11039,7 @@ class CGDOMJSProxyHandler_get(ClassMethod):
|
|||||||
def __init__(self, descriptor):
|
def __init__(self, descriptor):
|
||||||
args = [Argument('JSContext*', 'cx'),
|
args = [Argument('JSContext*', 'cx'),
|
||||||
Argument('JS::Handle<JSObject*>', 'proxy'),
|
Argument('JS::Handle<JSObject*>', 'proxy'),
|
||||||
Argument('JS::Handle<JSObject*>', 'receiver'),
|
Argument('JS::Handle<JS::Value>', 'receiver'),
|
||||||
Argument('JS::Handle<jsid>', 'id'),
|
Argument('JS::Handle<jsid>', 'id'),
|
||||||
Argument('JS::MutableHandle<JS::Value>', 'vp')]
|
Argument('JS::MutableHandle<JS::Value>', 'vp')]
|
||||||
ClassMethod.__init__(self, "get", "bool", args,
|
ClassMethod.__init__(self, "get", "bool", args,
|
||||||
@@ -11094,7 +11094,7 @@ class CGDOMJSProxyHandler_get(ClassMethod):
|
|||||||
|
|
||||||
getOnPrototype = dedent("""
|
getOnPrototype = dedent("""
|
||||||
bool foundOnPrototype;
|
bool foundOnPrototype;
|
||||||
if (!GetPropertyOnPrototype(cx, proxy, id, &foundOnPrototype, vp)) {
|
if (!GetPropertyOnPrototype(cx, proxy, receiver, id, &foundOnPrototype, vp)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,9 +66,8 @@ class JavaScriptBase : public WrapperOwner, public WrapperAnswer, public Base
|
|||||||
ReturnStatus* rs, bool* bp) {
|
ReturnStatus* rs, bool* bp) {
|
||||||
return Answer::RecvHasOwn(ObjectId::deserialize(objId), id, rs, bp);
|
return Answer::RecvHasOwn(ObjectId::deserialize(objId), id, rs, bp);
|
||||||
}
|
}
|
||||||
bool RecvGet(const uint64_t& objId, const ObjectVariant& receiverVar,
|
bool RecvGet(const uint64_t& objId, const JSVariant& receiverVar, const JSIDVariant& id,
|
||||||
const JSIDVariant& id,
|
ReturnStatus* rs, JSVariant* result) {
|
||||||
ReturnStatus* rs, JSVariant* result) {
|
|
||||||
return Answer::RecvGet(ObjectId::deserialize(objId), receiverVar, id, rs, result);
|
return Answer::RecvGet(ObjectId::deserialize(objId), receiverVar, id, rs, result);
|
||||||
}
|
}
|
||||||
bool RecvSet(const uint64_t& objId, const JSIDVariant& id, const JSVariant& value,
|
bool RecvSet(const uint64_t& objId, const JSIDVariant& id, const JSVariant& value,
|
||||||
@@ -155,8 +154,7 @@ class JavaScriptBase : public WrapperOwner, public WrapperAnswer, public Base
|
|||||||
ReturnStatus* rs, bool* bp) {
|
ReturnStatus* rs, bool* bp) {
|
||||||
return Base::SendHasOwn(objId.serialize(), id, rs, bp);
|
return Base::SendHasOwn(objId.serialize(), id, rs, bp);
|
||||||
}
|
}
|
||||||
bool SendGet(const ObjectId& objId, const ObjectVariant& receiverVar,
|
bool SendGet(const ObjectId& objId, const JSVariant& receiverVar, const JSIDVariant& id,
|
||||||
const JSIDVariant& id,
|
|
||||||
ReturnStatus* rs, JSVariant* result) {
|
ReturnStatus* rs, JSVariant* result) {
|
||||||
return Base::SendGet(objId.serialize(), receiverVar, id, rs, result);
|
return Base::SendGet(objId.serialize(), receiverVar, id, rs, result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ both:
|
|||||||
|
|
||||||
prio(high) sync Has(uint64_t objId, JSIDVariant id) returns (ReturnStatus rs, bool has);
|
prio(high) sync Has(uint64_t objId, JSIDVariant id) returns (ReturnStatus rs, bool has);
|
||||||
prio(high) sync HasOwn(uint64_t objId, JSIDVariant id) returns (ReturnStatus rs, bool has);
|
prio(high) sync HasOwn(uint64_t objId, JSIDVariant id) returns (ReturnStatus rs, bool has);
|
||||||
prio(high) sync Get(uint64_t objId, ObjectVariant receiver, JSIDVariant id) returns (ReturnStatus rs, JSVariant result);
|
prio(high) sync Get(uint64_t objId, JSVariant receiver, JSIDVariant id) returns (ReturnStatus rs, JSVariant result);
|
||||||
prio(high) sync Set(uint64_t objId, JSIDVariant id, JSVariant value, JSVariant receiver) returns (ReturnStatus rs);
|
prio(high) sync Set(uint64_t objId, JSIDVariant id, JSVariant value, JSVariant receiver) returns (ReturnStatus rs);
|
||||||
|
|
||||||
prio(high) sync IsExtensible(uint64_t objId) returns (ReturnStatus rs, bool result);
|
prio(high) sync IsExtensible(uint64_t objId) returns (ReturnStatus rs, bool result);
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ WrapperAnswer::RecvHasOwn(const ObjectId& objId, const JSIDVariant& idVar, Retur
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
WrapperAnswer::RecvGet(const ObjectId& objId, const ObjectVariant& receiverVar,
|
WrapperAnswer::RecvGet(const ObjectId& objId, const JSVariant& receiverVar,
|
||||||
const JSIDVariant& idVar, ReturnStatus* rs, JSVariant* result)
|
const JSIDVariant& idVar, ReturnStatus* rs, JSVariant* result)
|
||||||
{
|
{
|
||||||
// We may run scripted getters.
|
// We may run scripted getters.
|
||||||
@@ -289,8 +289,8 @@ WrapperAnswer::RecvGet(const ObjectId& objId, const ObjectVariant& receiverVar,
|
|||||||
if (!obj)
|
if (!obj)
|
||||||
return fail(aes, rs);
|
return fail(aes, rs);
|
||||||
|
|
||||||
RootedObject receiver(cx, fromObjectVariant(cx, receiverVar));
|
RootedValue receiver(cx);
|
||||||
if (!receiver)
|
if (!fromVariant(cx, receiverVar, &receiver))
|
||||||
return fail(aes, rs);
|
return fail(aes, rs);
|
||||||
|
|
||||||
RootedId id(cx);
|
RootedId id(cx);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class WrapperAnswer : public virtual JavaScriptShared
|
|||||||
ReturnStatus* rs, bool* foundp);
|
ReturnStatus* rs, bool* foundp);
|
||||||
bool RecvHasOwn(const ObjectId& objId, const JSIDVariant& id,
|
bool RecvHasOwn(const ObjectId& objId, const JSIDVariant& id,
|
||||||
ReturnStatus* rs, bool* foundp);
|
ReturnStatus* rs, bool* foundp);
|
||||||
bool RecvGet(const ObjectId& objId, const ObjectVariant& receiverVar,
|
bool RecvGet(const ObjectId& objId, const JSVariant& receiverVar,
|
||||||
const JSIDVariant& id,
|
const JSIDVariant& id,
|
||||||
ReturnStatus* rs, JSVariant* result);
|
ReturnStatus* rs, JSVariant* result);
|
||||||
bool RecvSet(const ObjectId& objId, const JSIDVariant& id, const JSVariant& value,
|
bool RecvSet(const ObjectId& objId, const JSIDVariant& id, const JSVariant& value,
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class CPOWProxyHandler : public BaseProxyHandler
|
|||||||
ObjectOpResult& result) const override;
|
ObjectOpResult& result) const override;
|
||||||
virtual bool isExtensible(JSContext* cx, HandleObject proxy, bool* extensible) const override;
|
virtual bool isExtensible(JSContext* cx, HandleObject proxy, bool* extensible) const override;
|
||||||
virtual bool has(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const override;
|
virtual bool has(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const override;
|
||||||
virtual bool get(JSContext* cx, HandleObject proxy, HandleObject receiver,
|
virtual bool get(JSContext* cx, HandleObject proxy, HandleValue receiver,
|
||||||
HandleId id, MutableHandleValue vp) const override;
|
HandleId id, MutableHandleValue vp) const override;
|
||||||
virtual bool set(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue v,
|
virtual bool set(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue v,
|
||||||
JS::HandleValue receiver, JS::ObjectOpResult& result) const override;
|
JS::HandleValue receiver, JS::ObjectOpResult& result) const override;
|
||||||
@@ -341,7 +341,7 @@ WrapperOwner::hasOwn(JSContext* cx, HandleObject proxy, HandleId id, bool* bp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CPOWProxyHandler::get(JSContext* cx, HandleObject proxy, HandleObject receiver,
|
CPOWProxyHandler::get(JSContext* cx, HandleObject proxy, HandleValue receiver,
|
||||||
HandleId id, MutableHandleValue vp) const
|
HandleId id, MutableHandleValue vp) const
|
||||||
{
|
{
|
||||||
FORWARD(get, (cx, proxy, receiver, id, vp));
|
FORWARD(get, (cx, proxy, receiver, id, vp));
|
||||||
@@ -458,13 +458,13 @@ WrapperOwner::DOMQI(JSContext* cx, JS::HandleObject proxy, JS::CallArgs& args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
WrapperOwner::get(JSContext* cx, HandleObject proxy, HandleObject receiver,
|
WrapperOwner::get(JSContext* cx, HandleObject proxy, HandleValue receiver,
|
||||||
HandleId id, MutableHandleValue vp)
|
HandleId id, MutableHandleValue vp)
|
||||||
{
|
{
|
||||||
ObjectId objId = idOf(proxy);
|
ObjectId objId = idOf(proxy);
|
||||||
|
|
||||||
ObjectVariant receiverVar;
|
JSVariant receiverVar;
|
||||||
if (!toObjectVariant(cx, receiver, &receiverVar))
|
if (!toVariant(cx, receiver, &receiverVar))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
JSIDVariant idVar;
|
JSIDVariant idVar;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class WrapperOwner : public virtual JavaScriptShared
|
|||||||
bool preventExtensions(JSContext* cx, JS::HandleObject proxy, JS::ObjectOpResult& result);
|
bool preventExtensions(JSContext* cx, JS::HandleObject proxy, JS::ObjectOpResult& result);
|
||||||
bool isExtensible(JSContext* cx, JS::HandleObject proxy, bool* extensible);
|
bool isExtensible(JSContext* cx, JS::HandleObject proxy, bool* extensible);
|
||||||
bool has(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, bool* bp);
|
bool has(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, bool* bp);
|
||||||
bool get(JSContext* cx, JS::HandleObject proxy, JS::HandleObject receiver,
|
bool get(JSContext* cx, JS::HandleObject proxy, JS::HandleValue receiver,
|
||||||
JS::HandleId id, JS::MutableHandleValue vp);
|
JS::HandleId id, JS::MutableHandleValue vp);
|
||||||
bool set(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue v,
|
bool set(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue v,
|
||||||
JS::HandleValue receiver, JS::ObjectOpResult& result);
|
JS::HandleValue receiver, JS::ObjectOpResult& result);
|
||||||
@@ -125,7 +125,7 @@ class WrapperOwner : public virtual JavaScriptShared
|
|||||||
ReturnStatus* rs, bool* bp) = 0;
|
ReturnStatus* rs, bool* bp) = 0;
|
||||||
virtual bool SendHasOwn(const ObjectId& objId, const JSIDVariant& id,
|
virtual bool SendHasOwn(const ObjectId& objId, const JSIDVariant& id,
|
||||||
ReturnStatus* rs, bool* bp) = 0;
|
ReturnStatus* rs, bool* bp) = 0;
|
||||||
virtual bool SendGet(const ObjectId& objId, const ObjectVariant& receiverVar,
|
virtual bool SendGet(const ObjectId& objId, const JSVariant& receiverVar,
|
||||||
const JSIDVariant& id,
|
const JSIDVariant& id,
|
||||||
ReturnStatus* rs, JSVariant* result) = 0;
|
ReturnStatus* rs, JSVariant* result) = 0;
|
||||||
virtual bool SendSet(const ObjectId& objId, const JSIDVariant& id, const JSVariant& value,
|
virtual bool SendSet(const ObjectId& objId, const JSIDVariant& id, const JSVariant& value,
|
||||||
|
|||||||
@@ -2920,12 +2920,16 @@ JS_GetPropertyDescriptor(JSContext* cx, HandleObject obj, const char* name,
|
|||||||
JS_PUBLIC_API(bool)
|
JS_PUBLIC_API(bool)
|
||||||
JS_GetPropertyById(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue vp)
|
JS_GetPropertyById(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue vp)
|
||||||
{
|
{
|
||||||
return JS_ForwardGetPropertyTo(cx, obj, id, obj, vp);
|
AssertHeapIsIdle(cx);
|
||||||
|
CHECK_REQUEST(cx);
|
||||||
|
assertSameCompartment(cx, obj, id);
|
||||||
|
|
||||||
|
return GetProperty(cx, obj, obj, id, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_PUBLIC_API(bool)
|
JS_PUBLIC_API(bool)
|
||||||
JS_ForwardGetPropertyTo(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::HandleObject onBehalfOf,
|
JS_ForwardGetPropertyTo(JSContext* cx, HandleObject obj, HandleId id, HandleValue onBehalfOf,
|
||||||
JS::MutableHandleValue vp)
|
MutableHandleValue vp)
|
||||||
{
|
{
|
||||||
AssertHeapIsIdle(cx);
|
AssertHeapIsIdle(cx);
|
||||||
CHECK_REQUEST(cx);
|
CHECK_REQUEST(cx);
|
||||||
@@ -2935,9 +2939,13 @@ JS_ForwardGetPropertyTo(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
JS_PUBLIC_API(bool)
|
JS_PUBLIC_API(bool)
|
||||||
JS_GetElement(JSContext* cx, HandleObject objArg, uint32_t index, MutableHandleValue vp)
|
JS_GetElement(JSContext* cx, HandleObject obj, uint32_t index, MutableHandleValue vp)
|
||||||
{
|
{
|
||||||
return JS_ForwardGetElementTo(cx, objArg, index, objArg, vp);
|
AssertHeapIsIdle(cx);
|
||||||
|
CHECK_REQUEST(cx);
|
||||||
|
assertSameCompartment(cx, obj);
|
||||||
|
|
||||||
|
return GetElement(cx, obj, obj, index, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_PUBLIC_API(bool)
|
JS_PUBLIC_API(bool)
|
||||||
|
|||||||
@@ -2853,7 +2853,7 @@ extern JS_PUBLIC_API(bool)
|
|||||||
JS_GetPropertyById(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp);
|
JS_GetPropertyById(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp);
|
||||||
|
|
||||||
extern JS_PUBLIC_API(bool)
|
extern JS_PUBLIC_API(bool)
|
||||||
JS_ForwardGetPropertyTo(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::HandleObject onBehalfOf,
|
JS_ForwardGetPropertyTo(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::HandleValue onBehalfOf,
|
||||||
JS::MutableHandleValue vp);
|
JS::MutableHandleValue vp);
|
||||||
|
|
||||||
extern JS_PUBLIC_API(bool)
|
extern JS_PUBLIC_API(bool)
|
||||||
|
|||||||
@@ -828,7 +828,7 @@ xpc::SandboxProxyHandler::hasOwn(JSContext* cx, JS::Handle<JSObject*> proxy,
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
xpc::SandboxProxyHandler::get(JSContext* cx, JS::Handle<JSObject*> proxy,
|
xpc::SandboxProxyHandler::get(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||||
JS::Handle<JSObject*> receiver,
|
JS::Handle<JS::Value> receiver,
|
||||||
JS::Handle<jsid> id,
|
JS::Handle<jsid> id,
|
||||||
JS::MutableHandle<Value> vp) const
|
JS::MutableHandle<Value> vp) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ AddonWrapper<Base>::getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper
|
|||||||
|
|
||||||
template<typename Base>
|
template<typename Base>
|
||||||
bool
|
bool
|
||||||
AddonWrapper<Base>::get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<JSObject*> receiver,
|
AddonWrapper<Base>::get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<Value> receiver,
|
||||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const
|
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const
|
||||||
{
|
{
|
||||||
Rooted<JSPropertyDescriptor> desc(cx);
|
Rooted<JSPropertyDescriptor> desc(cx);
|
||||||
@@ -180,10 +180,7 @@ AddonWrapper<Base>::get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle
|
|||||||
return Base::get(cx, wrapper, receiver, id, vp);
|
return Base::get(cx, wrapper, receiver, id, vp);
|
||||||
|
|
||||||
if (desc.getter()) {
|
if (desc.getter()) {
|
||||||
MOZ_ASSERT(desc.hasGetterObject());
|
return Call(cx, receiver, desc.getterObject(), HandleValueArray::empty(), vp);
|
||||||
AutoValueVector args(cx);
|
|
||||||
RootedValue fval(cx, ObjectValue(*desc.getterObject()));
|
|
||||||
return JS_CallFunctionValue(cx, receiver, fval, args, vp);
|
|
||||||
} else {
|
} else {
|
||||||
vp.set(desc.value());
|
vp.set(desc.value());
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class AddonWrapper : public Base {
|
|||||||
JS::ObjectOpResult& result) const override;
|
JS::ObjectOpResult& result) const override;
|
||||||
virtual bool delete_(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
|
virtual bool delete_(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
|
||||||
JS::ObjectOpResult& result) const override;
|
JS::ObjectOpResult& result) const override;
|
||||||
virtual bool get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<JSObject*> receiver,
|
virtual bool get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<JS::Value> receiver,
|
||||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const override;
|
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const override;
|
||||||
virtual bool set(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id, JS::HandleValue v,
|
virtual bool set(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id, JS::HandleValue v,
|
||||||
JS::HandleValue receiver, JS::ObjectOpResult& result) const override;
|
JS::HandleValue receiver, JS::ObjectOpResult& result) const override;
|
||||||
|
|||||||
@@ -50,8 +50,7 @@ WaiveXrayWrapper::getOwnPropertyDescriptor(JSContext* cx, HandleObject wrapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
WaiveXrayWrapper::get(JSContext* cx, HandleObject wrapper,
|
WaiveXrayWrapper::get(JSContext* cx, HandleObject wrapper, HandleValue receiver, HandleId id,
|
||||||
HandleObject receiver, HandleId id,
|
|
||||||
MutableHandleValue vp) const
|
MutableHandleValue vp) const
|
||||||
{
|
{
|
||||||
return CrossCompartmentWrapper::get(cx, wrapper, receiver, id, vp) &&
|
return CrossCompartmentWrapper::get(cx, wrapper, receiver, id, vp) &&
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class WaiveXrayWrapper : public js::CrossCompartmentWrapper {
|
|||||||
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
|
JS::MutableHandle<JSPropertyDescriptor> desc) const override;
|
||||||
virtual bool getPrototype(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
virtual bool getPrototype(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||||
JS::MutableHandle<JSObject*> protop) const override;
|
JS::MutableHandle<JSObject*> protop) const override;
|
||||||
virtual bool get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<JSObject*> receiver,
|
virtual bool get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<JS::Value> receiver,
|
||||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const override;
|
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const override;
|
||||||
virtual bool call(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
virtual bool call(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||||
const JS::CallArgs& args) const override;
|
const JS::CallArgs& args) const override;
|
||||||
|
|||||||
@@ -2092,13 +2092,18 @@ XrayWrapper<Base, Traits>::delete_(JSContext* cx, HandleObject wrapper,
|
|||||||
template <typename Base, typename Traits>
|
template <typename Base, typename Traits>
|
||||||
bool
|
bool
|
||||||
XrayWrapper<Base, Traits>::get(JSContext* cx, HandleObject wrapper,
|
XrayWrapper<Base, Traits>::get(JSContext* cx, HandleObject wrapper,
|
||||||
HandleObject receiver, HandleId id,
|
HandleValue receiver, HandleId id,
|
||||||
MutableHandleValue vp) const
|
MutableHandleValue vp) const
|
||||||
{
|
{
|
||||||
// Skip our Base if it isn't already ProxyHandler.
|
// Skip our Base if it isn't already ProxyHandler.
|
||||||
// NB: None of the functions we call are prepared for the receiver not
|
// NB: None of the functions we call are prepared for the receiver not
|
||||||
// being the wrapper, so ignore the receiver here.
|
// being the wrapper, so ignore the receiver here.
|
||||||
return js::BaseProxyHandler::get(cx, wrapper, Traits::HasPrototype ? receiver : wrapper, id, vp);
|
RootedValue thisv(cx);
|
||||||
|
if (Traits::HasPrototype)
|
||||||
|
thisv = receiver;
|
||||||
|
else
|
||||||
|
thisv.setObject(*wrapper);
|
||||||
|
return js::BaseProxyHandler::get(cx, wrapper, thisv, id, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Base, typename Traits>
|
template <typename Base, typename Traits>
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ class XrayWrapper : public Base {
|
|||||||
virtual bool isExtensible(JSContext* cx, JS::Handle<JSObject*> wrapper, bool* extensible) const override;
|
virtual bool isExtensible(JSContext* cx, JS::Handle<JSObject*> wrapper, bool* extensible) const override;
|
||||||
virtual bool has(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
|
virtual bool has(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
|
||||||
bool* bp) const override;
|
bool* bp) const override;
|
||||||
virtual bool get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<JSObject*> receiver,
|
virtual bool get(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::HandleValue receiver,
|
||||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const override;
|
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const override;
|
||||||
virtual bool set(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
|
virtual bool set(JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
|
||||||
JS::Handle<JS::Value> v, JS::Handle<JS::Value> receiver,
|
JS::Handle<JS::Value> v, JS::Handle<JS::Value> receiver,
|
||||||
@@ -520,7 +520,7 @@ public:
|
|||||||
// which implement them in terms of lower-level methods.
|
// which implement them in terms of lower-level methods.
|
||||||
virtual bool has(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
virtual bool has(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
||||||
bool* bp) const override;
|
bool* bp) const override;
|
||||||
virtual bool get(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<JSObject*> receiver,
|
virtual bool get(JSContext* cx, JS::Handle<JSObject*> proxy, JS::HandleValue receiver,
|
||||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const override;
|
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const override;
|
||||||
virtual bool set(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
virtual bool set(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
||||||
JS::Handle<JS::Value> v, JS::Handle<JS::Value> receiver,
|
JS::Handle<JS::Value> v, JS::Handle<JS::Value> receiver,
|
||||||
|
|||||||
Reference in New Issue
Block a user