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

Method JSMethodProxy_new

src/JSMethodProxy.cc:28–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) {
29 JSFunctionProxy *jsFunctionProxy;
30 PyObject *im_self;
31
32 if (!PyArg_ParseTuple(args, "O!O", &JSFunctionProxyType, &jsFunctionProxy, &im_self)) {
33 return NULL;
34 }
35
36 JSMethodProxy *self = (JSMethodProxy *)subtype->tp_alloc(subtype, 0);
37 if (self) {
38 self->self = im_self;
39 self->jsFunc = new JS::PersistentRootedObject(GLOBAL_CX);
40 self->jsFunc->set(*(jsFunctionProxy->jsFunc));
41 }
42
43 return (PyObject *)self;
44}
45
46PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyObject *args, PyObject *kwargs) {
47 JSContext *cx = GLOBAL_CX;

Callers

nothing calls this directly

Calls 1

setMethod · 0.65

Tested by

no test coverage detected