| 36 | } |
| 37 | |
| 38 | bool PyDictProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, |
| 39 | JS::ObjectOpResult &result) const { |
| 40 | PyObject *attrName = idToKey(cx, id); |
| 41 | PyObject *self = JS::GetMaybePtrFromReservedSlot<PyObject>(proxy, PyObjectSlot); |
| 42 | if (PyDict_DelItem(self, attrName) < 0) { |
| 43 | return result.failCantDelete(); // raises JS exception |
| 44 | } |
| 45 | return result.succeed(); |
| 46 | } |
| 47 | |
| 48 | bool PyDictProxyHandler::has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, |
| 49 | bool *bp) const { |