| 45 | } |
| 46 | |
| 47 | PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterProxy *self) { |
| 48 | PyListObject *seq = self->it.it_seq; |
| 49 | if (seq == NULL) { |
| 50 | return NULL; |
| 51 | } |
| 52 | |
| 53 | if (self->it.reversed) { |
| 54 | if (self->it.it_index >= 0) { |
| 55 | JS::RootedValue elementVal(GLOBAL_CX); |
| 56 | JS_GetElement(GLOBAL_CX, *(((JSArrayProxy *)seq)->jsArray), self->it.it_index--, &elementVal); |
| 57 | return pyTypeFactory(GLOBAL_CX, elementVal); |
| 58 | } |
| 59 | } |
| 60 | else { |
| 61 | if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { |
| 62 | JS::RootedValue elementVal(GLOBAL_CX); |
| 63 | JS_GetElement(GLOBAL_CX, *(((JSArrayProxy *)seq)->jsArray), self->it.it_index++, &elementVal); |
| 64 | return pyTypeFactory(GLOBAL_CX, elementVal); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | self->it.it_seq = NULL; |
| 69 | Py_DECREF(seq); |
| 70 | return NULL; |
| 71 | } |
| 72 | |
| 73 | PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_len(JSArrayIterProxy *self) { |
| 74 | Py_ssize_t len; |
nothing calls this directly
no test coverage detected