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

Method JSObjectValuesProxy_iter

src/JSObjectValuesProxy.cc:91–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter(JSObjectValuesProxy *self) {
92 JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType);
93 if (iterator == NULL) {
94 return NULL;
95 }
96 iterator->it.reversed = false;
97 iterator->it.it_index = 0;
98 iterator->it.kind = KIND_VALUES;
99 Py_INCREF(self->dv.dv_dict);
100 iterator->it.di_dict = self->dv.dv_dict;
101 iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX);
102 // Get **enumerable** own properties
103 if (!js::GetPropertyKeys(GLOBAL_CX, *(((JSObjectProxy *)(self->dv.dv_dict))->jsObject), JSITER_OWNONLY, iterator->it.props)) {
104 return NULL;
105 }
106 PyObject_GC_Track(iterator);
107 return (PyObject *)iterator;
108}
109
110PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter_reverse(JSObjectValuesProxy *self) {
111 JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected