| 286 | } |
| 287 | |
| 288 | PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self) { |
| 289 | // key iteration |
| 290 | JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType); |
| 291 | if (iterator == NULL) { |
| 292 | return NULL; |
| 293 | } |
| 294 | iterator->it.it_index = 0; |
| 295 | iterator->it.reversed = false; |
| 296 | iterator->it.kind = KIND_KEYS; |
| 297 | Py_INCREF(self); |
| 298 | iterator->it.di_dict = (PyDictObject *)self; |
| 299 | iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); |
| 300 | // Get **enumerable** own properties |
| 301 | if (!js::GetPropertyKeys(GLOBAL_CX, *(self->jsObject), JSITER_OWNONLY, iterator->it.props)) { |
| 302 | return NULL; |
| 303 | } |
| 304 | PyObject_GC_Track(iterator); |
| 305 | return (PyObject *)iterator; |
| 306 | } |
| 307 | |
| 308 | PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter_next(JSObjectProxy *self) { |
| 309 | PyObject *key = PyUnicode_FromString("next"); |
nothing calls this directly
no outgoing calls
no test coverage detected