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

Method getOwnPropertyDescriptor

src/PyDictProxyHandler.cc:53–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53bool 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
64bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
65 JS::HandleValue v, JS::HandleValue receiver,

Callers

nothing calls this directly

Calls 1

idToKeyFunction · 0.85

Tested by

no test coverage detected