| 51 | } |
| 52 | |
| 53 | bool PyDictProxyHandler::getOwnPropertyDescriptor( |
| 54 | JSContext *cx, JS::HandleObject proxy, JS::HandleId id, |
| 55 | JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> desc |
| 56 | ) const { |
| 57 | PyObject *attrName = idToKey(cx, id); |
| 58 | PyObject *self = JS::GetMaybePtrFromReservedSlot<PyObject>(proxy, PyObjectSlot); |
| 59 | PyObject *item = PyDict_GetItemWithError(self, attrName); // returns NULL without an exception set if the key wasn’t present. |
| 60 | |
| 61 | return handleGetOwnPropertyDescriptor(cx, id, desc, item); |
| 62 | } |
| 63 | |
| 64 | bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, |
| 65 | JS::HandleValue v, JS::HandleValue receiver, |