MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / delete_

Method delete_

src/PyDictProxyHandler.cc:38–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38bool 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
48bool PyDictProxyHandler::has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
49 bool *bp) const {

Callers

nothing calls this directly

Calls 1

idToKeyFunction · 0.85

Tested by

no test coverage detected