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

Method JSObjectKeysProxy_iter

src/JSObjectKeysProxy.cc:163–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter(JSObjectKeysProxy *self) {
164 JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType);
165 if (iterator == NULL) {
166 return NULL;
167 }
168 iterator->it.reversed = false;
169 iterator->it.it_index = 0;
170 iterator->it.kind = KIND_KEYS;
171 Py_INCREF(self->dv.dv_dict);
172 iterator->it.di_dict = self->dv.dv_dict;
173 iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX);
174 // Get **enumerable** own properties
175 if (!js::GetPropertyKeys(GLOBAL_CX, *(((JSObjectProxy *)(self->dv.dv_dict))->jsObject), JSITER_OWNONLY, iterator->it.props)) {
176 return NULL;
177 }
178 PyObject_GC_Track(iterator);
179 return (PyObject *)iterator;
180}
181
182PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter_reverse(JSObjectKeysProxy *self) {
183 JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected