Bug 787070 - Expandos on the xray of DOM prototypes should have effect on xrays of DOM nodes, stop forwarding sets to Traits. r=bholley.

--HG--
extra : rebase_source : dd7cccd24eb8d1c866a10784f29eb067ed29707a
This commit is contained in:
Peter Van der Beken 2014-09-15 16:52:11 +02:00
parent 3d173cc6d6
commit 29c43cc253
2 changed files with 2 additions and 34 deletions

View File

@ -1292,15 +1292,6 @@ XrayTraits::resolveOwnProperty(JSContext *cx, const Wrapper &jsWrapper,
return true;
}
bool
XrayTraits::set(JSContext *cx, HandleObject wrapper, HandleObject receiver, HandleId id,
bool strict, MutableHandleValue vp)
{
// Skip our Base if it isn't already BaseProxyHandler.
const js::BaseProxyHandler *handler = js::GetProxyHandler(wrapper);
return handler->js::BaseProxyHandler::set(cx, wrapper, receiver, id, strict, vp);
}
bool
XPCWrappedNativeXrayTraits::resolveOwnProperty(JSContext *cx, const Wrapper &jsWrapper,
HandleObject wrapper, HandleObject holder,
@ -1524,24 +1515,6 @@ DOMXrayTraits::defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
return XrayDefineProperty(cx, wrapper, obj, id, desc, defined);
}
bool
DOMXrayTraits::set(JSContext *cx, HandleObject wrapper, HandleObject receiver, HandleId id,
bool strict, MutableHandleValue vp)
{
MOZ_ASSERT(xpc::WrapperFactory::IsXrayWrapper(wrapper));
RootedObject obj(cx, getTargetObject(wrapper));
if (IsDOMProxy(obj)) {
const DOMProxyHandler* handler = GetDOMProxyHandler(obj);
bool done;
if (!handler->setCustom(cx, obj, id, vp, &done))
return false;
if (done)
return true;
}
return XrayTraits::set(cx, wrapper, receiver, id, strict, vp);
}
bool
DOMXrayTraits::enumerateNames(JSContext *cx, HandleObject wrapper, unsigned flags,
AutoIdVector &props)
@ -2062,10 +2035,10 @@ XrayWrapper<Base, Traits>::set(JSContext *cx, HandleObject wrapper,
bool strict, MutableHandleValue vp) const
{
MOZ_ASSERT(!Traits::HasPrototype);
// Delegate to Traits.
// Skip our Base if it isn't already BaseProxyHandler.
// NB: None of the functions we call are prepared for the receiver not
// being the wrapper, so ignore the receiver here.
return Traits::set(cx, wrapper, Traits::HasPrototype ? receiver : wrapper, id, strict, vp);
return js::BaseProxyHandler::set(cx, wrapper, wrapper, id, strict, vp);
}
template <typename Base, typename Traits>

View File

@ -80,9 +80,6 @@ public:
virtual void preserveWrapper(JSObject *target) = 0;
static bool set(JSContext *cx, JS::HandleObject wrapper, JS::HandleObject receiver, JS::HandleId id,
bool strict, JS::MutableHandleValue vp);
JSObject* getExpandoObject(JSContext *cx, JS::HandleObject target,
JS::HandleObject consumer);
JSObject* ensureExpandoObject(JSContext *cx, JS::HandleObject wrapper,
@ -180,8 +177,6 @@ public:
bool defineProperty(JSContext *cx, JS::HandleObject wrapper, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc,
JS::Handle<JSPropertyDescriptor> existingDesc, bool *defined);
static bool set(JSContext *cx, JS::HandleObject wrapper, JS::HandleObject receiver, JS::HandleId id,
bool strict, JS::MutableHandleValue vp);
virtual bool enumerateNames(JSContext *cx, JS::HandleObject wrapper, unsigned flags,
JS::AutoIdVector &props);
static bool call(JSContext *cx, JS::HandleObject wrapper,