forked from Distributive-Network/PythonMonkey
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyIterableProxyHandler.hh
More file actions
33 lines (26 loc) · 869 Bytes
/
PyIterableProxyHandler.hh
File metadata and controls
33 lines (26 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* @file PyIterableProxyHandler.hh
* @author Philippe Laporte (philippe@distributive.network)
* @brief Struct for creating JS proxy objects for iterables
* @date 2024-04-08
*
* @copyright Copyright (c) 2024 Distributive Corp.
*
*/
#ifndef PythonMonkey_PyIterableProxy_
#define PythonMonkey_PyIterableProxy_
#include "include/PyObjectProxyHandler.hh"
/**
* @brief This struct is the ProxyHandler for JS Proxy Iterable pythonmonkey creates to handle coercion from python iterables to JS Objects
*
*/
struct PyIterableProxyHandler : public PyObjectProxyHandler {
public:
PyIterableProxyHandler() : PyObjectProxyHandler(&family) {};
static const char family;
bool getOwnPropertyDescriptor(
JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> desc
) const override;
};
#endif