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

Method JSArrayProxy_append

src/JSArrayProxy.cc:778–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776}
777
778PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) {
779 Py_ssize_t len = JSArrayProxy_length(self);
780
781 JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), len + 1);
782 JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value));
783 JS_SetElement(GLOBAL_CX, *(self->jsArray), len, jValue);
784
785 Py_RETURN_NONE;
786}
787
788PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) {
789 PyObject *return_value = NULL;

Callers

nothing calls this directly

Calls 1

jsTypeFactoryFunction · 0.85

Tested by

no test coverage detected