PythonMonkey   v1.0.1 (dev)
Loading...
Searching...
No Matches
PyBytesProxyHandler Struct Reference

This struct is the ProxyHandler for JS Proxy Iterable pythonmonkey creates to handle coercion from python iterables to JS Objects. More...

#include <PyBytesProxyHandler.hh>

Inheritance diagram for PyBytesProxyHandler:
[legend]
Collaboration diagram for PyBytesProxyHandler:
[legend]

Public Member Functions

 PyBytesProxyHandler ()
 
bool set (JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue v, JS::HandleValue receiver, JS::ObjectOpResult &result) const override
 [[Set]]
 
bool getOwnPropertyDescriptor (JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::MutableHandle< mozilla::Maybe< JS::PropertyDescriptor > > desc) const override
 
void finalize (JS::GCContext *gcx, JSObject *proxy) const override
 Handles python object reference count when JS Proxy object is finalized.
 
- Public Member Functions inherited from PyObjectProxyHandler
 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
 
- Public Member Functions inherited from PyBaseProxyHandler
 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 Attributes

static const char family = 0
 
- Static Public Attributes inherited from PyObjectProxyHandler
static const char family = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from PyObjectProxyHandler
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
 

Detailed Description

This struct is the ProxyHandler for JS Proxy Iterable pythonmonkey creates to handle coercion from python iterables to JS Objects.

Constructor & Destructor Documentation

◆ PyBytesProxyHandler()

PyBytesProxyHandler::PyBytesProxyHandler ( )

Member Function Documentation

◆ finalize()

void PyBytesProxyHandler::finalize ( JS::GCContext *  gcx,
JSObject *  proxy 
) const
override

Handles python object reference count when JS Proxy object is finalized.

Parameters
gcxpointer to JS::GCContext
proxythe proxy object being finalized

◆ getOwnPropertyDescriptor()

bool PyBytesProxyHandler::getOwnPropertyDescriptor ( JSContext *  cx,
JS::HandleObject  proxy,
JS::HandleId  id,
JS::MutableHandle< mozilla::Maybe< JS::PropertyDescriptor > >  desc 
) const
override

◆ set()

bool PyBytesProxyHandler::set ( JSContext *  cx,
JS::HandleObject  proxy,
JS::HandleId  id,
JS::HandleValue  v,
JS::HandleValue  receiver,
JS::ObjectOpResult &  result 
) const
override

[[Set]]

Parameters
cxpointer to JSContext
proxyThe proxy object who's property we wish to set
idKey of the property we wish to set
vValue that we wish to set the property to
receiverThe this value to use when executing any code
resultwhether or not the call succeeded
Returns
true call succeed
false call failed and an exception has been raised

Member Data Documentation

◆ family

const char PyBytesProxyHandler::family = 0
static

The documentation for this struct was generated from the following files: