| 706 | } |
| 707 | |
| 708 | PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value) { |
| 709 | Py_ssize_t selfLength = JSArrayProxy_length(self); |
| 710 | Py_ssize_t valueLength = Py_SIZE(value); |
| 711 | |
| 712 | // allocate extra spacePy_SIZE |
| 713 | JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), selfLength + valueLength); |
| 714 | |
| 715 | JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); |
| 716 | JS::RootedObject jRootedValue = JS::RootedObject(GLOBAL_CX, jValue.toObjectOrNull()); |
| 717 | |
| 718 | JS::RootedValue elementVal(GLOBAL_CX); |
| 719 | for (Py_ssize_t inputIdx = 0; inputIdx < valueLength; inputIdx++) { |
| 720 | JS_GetElement(GLOBAL_CX, jRootedValue, inputIdx, &elementVal); |
| 721 | JS_SetElement(GLOBAL_CX, *(self->jsArray), selfLength + inputIdx, elementVal); |
| 722 | } |
| 723 | |
| 724 | Py_INCREF(self); |
| 725 | return (PyObject *)self; |
| 726 | } |
| 727 | |
| 728 | PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n) { |
| 729 | Py_ssize_t input_size = JSArrayProxy_length(self); |
nothing calls this directly
no test coverage detected