![]() |
PythonMonkey v1.1.2 (dev)
|
This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates to handle coercion from python objects to JS Objects. More...
#include <PyObjectProxyHandler.hh>
Public Member Functions | |
PyObjectProxyHandler () | |
PyObjectProxyHandler (const void *childFamily) | |
void | finalize (JS::GCContext *gcx, JSObject *proxy) const override |
Handles python object reference count when JS Proxy object is finalized. | |
bool | ownPropertyKeys (JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override |
[[OwnPropertyKeys]] | |
bool | delete_ (JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const override |
[[Delete]] | |
bool | has (JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const override |
[[HasProperty]] | |
bool | set (JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue v, JS::HandleValue receiver, JS::ObjectOpResult &result) const override |
[[Set]] | |
bool | enumerate (JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override |
[[Enumerate]] | |
bool | hasOwn (JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const override |
Returns true if id is in proxy , false otherwise. | |
bool | getOwnEnumerablePropertyKeys (JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override |
Returns vector of proxy's own keys. | |
bool | getOwnPropertyDescriptor (JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::MutableHandle< mozilla::Maybe< JS::PropertyDescriptor > > desc) const override |
bool | defineProperty (JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::Handle< JS::PropertyDescriptor > desc, JS::ObjectOpResult &result) const override |
bool | getBuiltinClass (JSContext *cx, JS::HandleObject proxy, js::ESClass *cls) const override |
![]() | |
PyBaseProxyHandler (const void *family) | |
bool | getPrototypeIfOrdinary (JSContext *cx, JS::HandleObject proxy, bool *isOrdinary, JS::MutableHandleObject protop) const override final |
bool | preventExtensions (JSContext *cx, JS::HandleObject proxy, JS::ObjectOpResult &result) const override final |
bool | isExtensible (JSContext *cx, JS::HandleObject proxy, bool *extensible) const override final |
Static Public Member Functions | |
static bool | handleOwnPropertyKeys (JSContext *cx, PyObject *keys, size_t length, JS::MutableHandleIdVector props) |
Helper function used by dicts and objects for ownPropertyKeys. | |
static bool | handleGetOwnPropertyDescriptor (JSContext *cx, JS::HandleId id, JS::MutableHandle< mozilla::Maybe< JS::PropertyDescriptor > > desc, PyObject *item) |
Helper function used by dicts and objects for get OwnPropertyDescriptor. | |
static bool | object_toString (JSContext *cx, unsigned argc, JS::Value *vp) |
Helper function used by dicts and objects to convert dict/object to String. | |
static bool | object_toLocaleString (JSContext *cx, unsigned argc, JS::Value *vp) |
Helper function used by dicts and objects to convert dict/object to LocaleString. | |
static bool | object_valueOf (JSContext *cx, unsigned argc, JS::Value *vp) |
Helper function used by dicts and objects to get valueOf, just returns a new reference to self | |
Static Public Attributes | |
static const char | family = 0 |
This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates to handle coercion from python objects to JS Objects.
PyObjectProxyHandler::PyObjectProxyHandler | ( | ) |
PyObjectProxyHandler::PyObjectProxyHandler | ( | const void * | childFamily | ) |
|
override |
|
override |
[[Delete]]
cx | - pointer to JSContext |
proxy | - The proxy object who's property we wish to delete |
id | - The key we wish to delete |
result | - whether the call succeeded or not |
|
override |
[[Enumerate]]
cx | - pointer to JSContext |
proxy | - The proxy object who's keys we output |
props | - out-parameter of object IDs |
|
override |
Handles python object reference count when JS Proxy object is finalized.
gcx | pointer to JS::GCContext |
proxy | the proxy object being finalized |
|
override |
|
override |
Returns vector of proxy's own keys.
cx | - Pointer to the JSContext |
proxy | - the proxy object |
props | - out parameter, the vector of proxy's own keys |
|
override |
|
static |
Helper function used by dicts and objects for get OwnPropertyDescriptor.
cx | - pointer to the JSContext |
id | - id of the prop to get |
desc | - out-param, the property descriptor |
item | - the python object to be converted to a JS prop |
|
static |
Helper function used by dicts and objects for ownPropertyKeys.
cx | - pointer to the JSContext |
keys | - PyListObject containing the keys of the proxy'd dict/object |
length | - the length of keys param |
props | - out-param, will be a JS vector of the keys converted to JS Ids |
|
override |
[[HasProperty]]
cx | - pointer to JSContext |
proxy | - The proxy object who's propery we wish to check |
id | - key value of the property to check |
bp | - out-paramter: true if object has property, false if not |
|
override |
Returns true if id
is in proxy
, false otherwise.
cx | pointer to JSContext |
proxy | The proxy object who's property we wish to check |
id | Key of the property we wish to check |
bp | out-paramter: true if object has property, false if not |
|
static |
Helper function used by dicts and objects to convert dict/object to LocaleString.
cx | - pointer to the JSContext |
argc | - unused |
vp | - unused |
|
static |
Helper function used by dicts and objects to convert dict/object to String.
cx | - pointer to the JSContext |
argc | - unused |
vp | - unused |
|
static |
Helper function used by dicts and objects to get valueOf, just returns a new reference to self
cx | - pointer to the JSContext |
argc | - unused |
vp | - unused |
|
override |
[[OwnPropertyKeys]]
cx | - pointer to JSContext |
proxy | - The proxy object who's keys we output |
props | - out-parameter of object IDs |
|
override |
[[Set]]
cx | pointer to JSContext |
proxy | The proxy object who's property we wish to set |
id | Key of the property we wish to set |
v | Value that we wish to set the property to |
receiver | The this value to use when executing any code |
result | whether or not the call succeeded |
|
static |