Issue #1257 - Part1: Remove watch class-hook and proxy trap.

This commit is contained in:
wolfbeast 2019-10-26 13:08:45 +02:00 committed by Roy Tam
commit 3b9fbdc71d
18 changed files with 5 additions and 145 deletions

View file

@ -418,20 +418,6 @@ BaseProxyHandler::setImmutablePrototype(JSContext* cx, HandleObject proxy, bool*
return true;
}
bool
BaseProxyHandler::watch(JSContext* cx, HandleObject proxy, HandleId id, HandleObject callable) const
{
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_WATCH,
proxy->getClass()->name);
return false;
}
bool
BaseProxyHandler::unwatch(JSContext* cx, HandleObject proxy, HandleId id) const
{
return true;
}
bool
BaseProxyHandler::getElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end,
ElementAdder* adder) const

View file

@ -504,20 +504,6 @@ Proxy::boxedValue_unbox(JSContext* cx, HandleObject proxy, MutableHandleValue vp
JSObject * const TaggedProto::LazyProto = reinterpret_cast<JSObject*>(0x1);
/* static */ bool
Proxy::watch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleObject callable)
{
JS_CHECK_RECURSION(cx, return false);
return proxy->as<ProxyObject>().handler()->watch(cx, proxy, id, callable);
}
/* static */ bool
Proxy::unwatch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id)
{
JS_CHECK_RECURSION(cx, return false);
return proxy->as<ProxyObject>().handler()->unwatch(cx, proxy, id);
}
/* static */ bool
Proxy::getElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end,
ElementAdder* adder)
@ -698,18 +684,6 @@ js::proxy_Construct(JSContext* cx, unsigned argc, Value* vp)
return Proxy::construct(cx, proxy, args);
}
bool
js::proxy_Watch(JSContext* cx, HandleObject obj, HandleId id, HandleObject callable)
{
return Proxy::watch(cx, obj, id, callable);
}
bool
js::proxy_Unwatch(JSContext* cx, HandleObject obj, HandleId id)
{
return Proxy::unwatch(cx, obj, id);
}
bool
js::proxy_GetElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end,
ElementAdder* adder)
@ -750,7 +724,6 @@ const ObjectOps js::ProxyObjectOps = {
js::proxy_SetProperty,
js::proxy_GetOwnPropertyDescriptor,
js::proxy_DeleteProperty,
js::proxy_Watch, js::proxy_Unwatch,
js::proxy_GetElements,
nullptr, /* enumerate */
js::proxy_FunToString

View file

@ -65,9 +65,6 @@ class Proxy
static bool regexp_toShared(JSContext* cx, HandleObject proxy, RegExpGuard* g);
static bool boxedValue_unbox(JSContext* cx, HandleObject proxy, MutableHandleValue vp);
static bool watch(JSContext* cx, HandleObject proxy, HandleId id, HandleObject callable);
static bool unwatch(JSContext* cx, HandleObject proxy, HandleId id);
static bool getElements(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end,
ElementAdder* adder);

View file

@ -130,24 +130,5 @@ SecurityWrapper<Base>::defineProperty(JSContext* cx, HandleObject wrapper, Handl
return Base::defineProperty(cx, wrapper, id, desc, result);
}
template <class Base>
bool
SecurityWrapper<Base>::watch(JSContext* cx, HandleObject proxy,
HandleId id, HandleObject callable) const
{
ReportUnwrapDenied(cx);
return false;
}
template <class Base>
bool
SecurityWrapper<Base>::unwatch(JSContext* cx, HandleObject proxy,
HandleId id) const
{
ReportUnwrapDenied(cx);
return false;
}
template class js::SecurityWrapper<Wrapper>;
template class js::SecurityWrapper<CrossCompartmentWrapper>;