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

Class PyDictProxyHandler

include/PyDictProxyHandler.hh:21–124  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

19 *
20 */
21struct PyDictProxyHandler : public PyObjectProxyHandler {
22public:
23 PyDictProxyHandler() : PyObjectProxyHandler(&family) {};
24 static const char family;
25
26 /**
27 * @brief [[OwnPropertyKeys]]
28 *
29 * @param cx - pointer to JSContext
30 * @param proxy - The proxy object who's keys we output
31 * @param props - out-parameter of object IDs
32 * @return true - call succeeded
33 * @return false - call failed and an exception has been raised
34 */
35 bool ownPropertyKeys(JSContext *cx, JS::HandleObject proxy,
36 JS::MutableHandleIdVector props) const override;
37 /**
38 * @brief [[Delete]]
39 *
40 * @param cx - pointer to JSContext
41 * @param proxy - The proxy object who's property we wish to delete
42 * @param id - The key we wish to delete
43 * @param result - whether the call succeeded or not
44 * @return true - call succeeded
45 * @return false - call failed and an exception has been raised
46 */
47 bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
48 JS::ObjectOpResult &result) const override;
49 /**
50 * @brief [[HasProperty]]
51 * @param cx - pointer to JSContext
52 * @param proxy - The proxy object who's property we wish to check
53 * @param id - key value of the property to check
54 * @param bp - out-paramter: true if object has property, false if not
55 * @return true - call succeeded
56 * @return false - call failed and an exception has been raised
57 */
58 bool has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
59 bool *bp) const override;
60 /**
61 * @brief [[Set]]
62 *
63 * @param cx pointer to JSContext
64 * @param proxy The proxy object who's property we wish to set
65 * @param id Key of the property we wish to set
66 * @param v Value that we wish to set the property to
67 * @param receiver The `this` value to use when executing any code
68 * @param result whether or not the call succeeded
69 * @return true call succeed
70 * @return false call failed and an exception has been raised
71 */
72 bool set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
73 JS::HandleValue v, JS::HandleValue receiver,
74 JS::ObjectOpResult &result) const override;
75 /**
76 * @brief [[Enumerate]]
77 *
78 * @param cx - pointer to JSContext

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected