* @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates * to handle coercion from python lists to JS Array objects */
| 19 | * to handle coercion from python lists to JS Array objects |
| 20 | */ |
| 21 | struct PyListProxyHandler : public PyBaseProxyHandler { |
| 22 | public: |
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected