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

Method delete_

src/PyObjectProxyHandler.cc:124–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124bool PyObjectProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
125 JS::ObjectOpResult &result) const {
126 PyObject *attrName = idToKey(cx, id);
127 PyObject *self = JS::GetMaybePtrFromReservedSlot<PyObject>(proxy, PyObjectSlot);
128 if (PyObject_SetAttr(self, attrName, NULL) < 0) {
129 return result.failCantDelete(); // raises JS exception
130 }
131 return result.succeed();
132}
133
134bool PyObjectProxyHandler::has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
135 bool *bp) const {

Callers

nothing calls this directly

Calls 1

idToKeyFunction · 0.85

Tested by

no test coverage detected