| 26 | } |
| 27 | |
| 28 | PyObject *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 | |
| 46 | PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyObject *args, PyObject *kwargs) { |
| 47 | JSContext *cx = GLOBAL_CX; |