| 2136 | } |
| 2137 | |
| 2138 | bool PyListProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { |
| 2139 | // Modified from https://hg.mozilla.org/releases/mozilla-esr102/file/3b574e1/dom/base/RemoteOuterWindowProxy.cpp#l137 |
| 2140 | PyObject *self = JS::GetMaybePtrFromReservedSlot<PyObject>(proxy, PyObjectSlot); |
| 2141 | int32_t length = PyList_Size(self); |
| 2142 | if (!props.reserve(length + 1)) { |
| 2143 | return false; |
| 2144 | } |
| 2145 | // item indexes |
| 2146 | for (int32_t i = 0; i < length; ++i) { |
| 2147 | props.infallibleAppend(JS::PropertyKey::Int(i)); |
| 2148 | } |
| 2149 | // the "length" property |
| 2150 | props.infallibleAppend(JS::PropertyKey::NonIntAtom(JS_AtomizeString(cx, "length"))); |
| 2151 | return true; |
| 2152 | } |
| 2153 | |
| 2154 | bool PyListProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const { |
| 2155 | Py_ssize_t index; |
nothing calls this directly
no outgoing calls
no test coverage detected