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

Method JSArrayProxy_copy

src/JSArrayProxy.cc:766–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764}
765
766PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) {
767 JS::Rooted<JS::ValueArray<2>> jArgs(GLOBAL_CX);
768 jArgs[0].setInt32(0);
769 jArgs[1].setInt32(JSArrayProxy_length(self));
770 JS::RootedValue jReturnedArray(GLOBAL_CX);
771 if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "slice", jArgs, &jReturnedArray)) {
772 PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name);
773 return NULL;
774 }
775 return pyTypeFactory(GLOBAL_CX, jReturnedArray);
776}
777
778PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) {
779 Py_ssize_t len = JSArrayProxy_length(self);

Callers

nothing calls this directly

Calls 1

pyTypeFactoryFunction · 0.85

Tested by

no test coverage detected