| 26 | const char PyObjectProxyHandler::family = 0; |
| 27 | |
| 28 | bool PyObjectProxyHandler::handleOwnPropertyKeys(JSContext *cx, PyObject *keys, size_t length, JS::MutableHandleIdVector props) { |
| 29 | if (!props.reserve(length)) { |
| 30 | return false; // out of memory |
| 31 | } |
| 32 | |
| 33 | for (size_t i = 0; i < length; i++) { |
| 34 | PyObject *key = PyList_GetItem(keys, i); |
| 35 | JS::RootedId jsId(cx); |
| 36 | if (!keyToId(key, &jsId)) { |
| 37 | continue; // skip over keys that are not str or int |
| 38 | } |
| 39 | props.infallibleAppend(jsId); |
| 40 | } |
| 41 | return true; |
| 42 | } |
| 43 | |
| 44 | bool PyObjectProxyHandler::handleGetOwnPropertyDescriptor(JSContext *cx, JS::HandleId id, |
| 45 | JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> desc, PyObject *item) { |