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

Class PyBytesProxyHandler

include/PyBytesProxyHandler.hh:22–55  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

20 *
21 */
22struct PyBytesProxyHandler : public PyObjectProxyHandler {
23public:
24 PyBytesProxyHandler() : PyObjectProxyHandler(&family) {};
25 static const char family;
26
27 /**
28 * @brief [[Set]]
29 *
30 * @param cx pointer to JSContext
31 * @param proxy The proxy object who's property we wish to set
32 * @param id Key of the property we wish to set
33 * @param v Value that we wish to set the property to
34 * @param receiver The `this` value to use when executing any code
35 * @param result whether or not the call succeeded
36 * @return true call succeed
37 * @return false call failed and an exception has been raised
38 */
39 bool set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
40 JS::HandleValue v, JS::HandleValue receiver,
41 JS::ObjectOpResult &result) const override;
42
43 bool getOwnPropertyDescriptor(
44 JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
45 JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> desc
46 ) const override;
47
48 /**
49 * @brief Handles python object reference count when JS Proxy object is finalized
50 *
51 * @param gcx pointer to JS::GCContext
52 * @param proxy the proxy object being finalized
53 */
54 void finalize(JS::GCContext *gcx, JSObject *proxy) const override;
55};
56
57#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected