| 2152 | } |
| 2153 | |
| 2154 | bool PyListProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const { |
| 2155 | Py_ssize_t index; |
| 2156 | PyObject *self = JS::GetMaybePtrFromReservedSlot<PyObject>(proxy, PyObjectSlot); |
| 2157 | if (!idToIndex(cx, id, &index)) { |
| 2158 | return result.failBadIndex(); |
| 2159 | } |
| 2160 | |
| 2161 | // Set to undefined instead of actually deleting it |
| 2162 | if (PyList_SetItem(self, index, Py_None) < 0) { |
| 2163 | return result.failCantDelete(); |
| 2164 | } |
| 2165 | return result.succeed(); |
| 2166 | } |
| 2167 | |
| 2168 | bool PyListProxyHandler::isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const { |
| 2169 | *answer = JS::IsArrayAnswer::Array; |
nothing calls this directly
no test coverage detected