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

Method JSObjectKeysProxy_iter_reverse

src/JSObjectKeysProxy.cc:182–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter_reverse(JSObjectKeysProxy *self) {
183 JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType);
184 if (iterator == NULL) {
185 return NULL;
186 }
187 iterator->it.reversed = true;
188 iterator->it.it_index = JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_length(self) - 1;
189 iterator->it.kind = KIND_KEYS;
190 Py_INCREF(self->dv.dv_dict);
191 iterator->it.di_dict = self->dv.dv_dict;
192 iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX);
193 // Get **enumerable** own properties
194 if (!js::GetPropertyKeys(GLOBAL_CX, *(((JSObjectProxy *)(self->dv.dv_dict))->jsObject), JSITER_OWNONLY, iterator->it.props)) {
195 return NULL;
196 }
197 PyObject_GC_Track(iterator);
198 return (PyObject *)iterator;
199}
200
201PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_repr(JSObjectKeysProxy *self) {
202 PyObject *seq;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected