MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / PyListProxyHandler

Class PyListProxyHandler

include/PyListProxyHandler.hh:21–48  ·  view source on GitHub ↗

* @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates * to handle coercion from python lists to JS Array objects */

Source from the content-addressed store, hash-verified

19 * to handle coercion from python lists to JS Array objects
20 */
21struct PyListProxyHandler : public PyBaseProxyHandler {
22public:
23 PyListProxyHandler() : PyBaseProxyHandler(&family) {};
24 static const char family;
25
26 /**
27 * @brief Handles python object reference count when JS Proxy object is finalized
28 *
29 * @param gcx pointer to JS::GCContext
30 * @param proxy the proxy object being finalized
31 */
32 void finalize(JS::GCContext *gcx, JSObject *proxy) const override;
33
34 bool getOwnPropertyDescriptor(
35 JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
36 JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> desc
37 ) const override;
38
39 bool defineProperty(
40 JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
41 JS::Handle<JS::PropertyDescriptor> desc, JS::ObjectOpResult &result
42 ) const override;
43
44 bool ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override;
45 bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const override;
46 bool isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const override;
47 bool getBuiltinClass(JSContext *cx, JS::HandleObject proxy, js::ESClass *cls) const override;
48};
49
50#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected