Bug 1042398 - Add a WaiveXrayWrapper override for ::iterate. r=gabor

I thought we had overrides for all the proxy traps that returned non-primitive
values, but it looks like we missed one.
This commit is contained in:
Bobby Holley 2014-07-23 15:20:05 -07:00
parent 391625f1bf
commit 344267d98d
2 changed files with 11 additions and 0 deletions

View File

@ -66,6 +66,14 @@ WaiveXrayWrapper::get(JSContext *cx, HandleObject wrapper,
WrapperFactory::WaiveXrayAndWrap(cx, vp);
}
bool
WaiveXrayWrapper::iterate(JSContext *cx, HandleObject proxy, unsigned flags,
MutableHandleValue vp) const
{
return CrossCompartmentWrapper::iterate(cx, proxy, flags, vp) &&
WrapperFactory::WaiveXrayAndWrap(cx, vp);
}
bool
WaiveXrayWrapper::call(JSContext *cx, HandleObject wrapper, const JS::CallArgs &args) const
{

View File

@ -26,6 +26,9 @@ class WaiveXrayWrapper : public js::CrossCompartmentWrapper {
JS::MutableHandle<JSPropertyDescriptor> desc) const MOZ_OVERRIDE;
virtual bool get(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<JSObject*> receiver,
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const MOZ_OVERRIDE;
virtual bool iterate(JSContext *cx, JS::Handle<JSObject*> proxy, unsigned flags,
JS::MutableHandle<JS::Value> vp) const MOZ_OVERRIDE;
virtual bool call(JSContext *cx, JS::Handle<JSObject*> wrapper,
const JS::CallArgs &args) const MOZ_OVERRIDE;