From c59c9682d351e641f184e1f8095f399fee179f62 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 26 Oct 2019 13:08:45 +0200 Subject: Issue #1257 - Part1: Remove watch class-hook and proxy trap. --- dom/base/nsGlobalWindow.cpp | 19 ------------------- dom/bindings/BindingUtils.cpp | 2 -- dom/bindings/Codegen.py | 6 +++--- dom/bindings/DOMJSProxyHandler.cpp | 13 ------------- dom/bindings/DOMJSProxyHandler.h | 5 ----- dom/plugins/base/nsJSNPRuntime.cpp | 1 - 6 files changed, 3 insertions(+), 43 deletions(-) (limited to 'dom') diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index ec546f068..1288b3435 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -1026,11 +1026,6 @@ public: return false; } - virtual bool watch(JSContext *cx, JS::Handle proxy, - JS::Handle id, JS::Handle callable) const override; - virtual bool unwatch(JSContext *cx, JS::Handle proxy, - JS::Handle id) const override; - static void ObjectMoved(JSObject *obj, const JSObject *old); static const nsOuterWindowProxy singleton; @@ -1398,20 +1393,6 @@ nsOuterWindowProxy::AppendIndexedPropertyNames(JSContext *cx, JSObject *proxy, return true; } -bool -nsOuterWindowProxy::watch(JSContext *cx, JS::Handle proxy, - JS::Handle id, JS::Handle callable) const -{ - return js::WatchGuts(cx, proxy, id, callable); -} - -bool -nsOuterWindowProxy::unwatch(JSContext *cx, JS::Handle proxy, - JS::Handle id) const -{ - return js::UnwatchGuts(cx, proxy, id); -} - void nsOuterWindowProxy::ObjectMoved(JSObject *obj, const JSObject *old) { diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index a26fc4422..6e0db29b1 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -1968,8 +1968,6 @@ const js::ObjectOps sInterfaceObjectClassObjectOps = { nullptr, /* setProperty */ nullptr, /* getOwnPropertyDescriptor */ nullptr, /* deleteProperty */ - nullptr, /* watch */ - nullptr, /* unwatch */ nullptr, /* getElements */ nullptr, /* enumerate */ InterfaceObjectToString, /* funToString */ diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index d7d700a96..924241aa0 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -13169,9 +13169,9 @@ class CGDictionary(CGThing): # continues to match the list in test_Object.prototype_props.html if (member.identifier.name in ["constructor", "toSource", "toString", "toLocaleString", "valueOf", - "watch", "unwatch", "hasOwnProperty", "isPrototypeOf", - "propertyIsEnumerable", "__defineGetter__", "__defineSetter__", - "__lookupGetter__", "__lookupSetter__", "__proto__"]): + "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", + "__defineGetter__", "__defineSetter__", "__lookupGetter__", + "__lookupSetter__", "__proto__"]): raise TypeError("'%s' member of %s dictionary shadows " "a property of Object.prototype, and Xrays to " "Object can't handle that.\n" diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index 23f0abd88..49281c1c2 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -274,19 +274,6 @@ DOMProxyHandler::delete_(JSContext* cx, JS::Handle proxy, return result.succeed(); } -bool -BaseDOMProxyHandler::watch(JSContext* cx, JS::Handle proxy, JS::Handle id, - JS::Handle callable) const -{ - return js::WatchGuts(cx, proxy, id, callable); -} - -bool -BaseDOMProxyHandler::unwatch(JSContext* cx, JS::Handle proxy, JS::Handle id) const -{ - return js::UnwatchGuts(cx, proxy, id); -} - bool BaseDOMProxyHandler::ownPropertyKeys(JSContext* cx, JS::Handle proxy, diff --git a/dom/bindings/DOMJSProxyHandler.h b/dom/bindings/DOMJSProxyHandler.h index 1781649cc..e3e151b7a 100644 --- a/dom/bindings/DOMJSProxyHandler.h +++ b/dom/bindings/DOMJSProxyHandler.h @@ -72,11 +72,6 @@ public: virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::Handle proxy, JS::AutoIdVector &props) const override; - bool watch(JSContext* cx, JS::Handle proxy, JS::Handle id, - JS::Handle callable) const override; - bool unwatch(JSContext* cx, JS::Handle proxy, - JS::Handle id) const override; - protected: // Hook for subclasses to implement shared ownPropertyKeys()/keys() // functionality. The "flags" argument is either JSITER_OWNONLY (for keys()) diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 05e0ec4ba..1d42c18d6 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -248,7 +248,6 @@ const static js::ObjectOps sNPObjectJSWrapperObjectOps = { nullptr, // setProperty nullptr, // getOwnPropertyDescriptor nullptr, // deleteProperty - nullptr, nullptr, // watch/unwatch nullptr, // getElements NPObjWrapper_Enumerate, nullptr, -- cgit v1.2.3