| 62 | } |
| 63 | |
| 64 | bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, |
| 65 | JS::HandleValue v, JS::HandleValue receiver, |
| 66 | JS::ObjectOpResult &result) const { |
| 67 | JS::RootedValue rootedV(cx, v); |
| 68 | PyObject *attrName = idToKey(cx, id); |
| 69 | |
| 70 | PyObject *self = JS::GetMaybePtrFromReservedSlot<PyObject>(proxy, PyObjectSlot); |
| 71 | PyObject *value = pyTypeFactory(cx, rootedV); |
| 72 | if (PyDict_SetItem(self, attrName, value)) { |
| 73 | Py_DECREF(value); |
| 74 | return result.failCantSetInterposed(); // raises JS exception |
| 75 | } |
| 76 | Py_DECREF(value); |
| 77 | return result.succeed(); |
| 78 | } |
| 79 | |
| 80 | bool PyDictProxyHandler::enumerate(JSContext *cx, JS::HandleObject proxy, |
| 81 | JS::MutableHandleIdVector props) const { |
nothing calls this directly
no test coverage detected