# HG changeset patch # User Atul Varma # Date 1248650672 25200 # Node ID 19f3bc257a251cd10b988d0127732c7da91eb3e3 # Parent b5160c82be6526f0ab2c8e3909dbd63fa6f0d12a Added comments for the function holder class. diff -r b5160c82be65 -r 19f3bc257a25 function.c --- a/function.c Sun Jul 26 16:19:12 2009 -0700 +++ b/function.c Sun Jul 26 16:24:32 2009 -0700 @@ -58,6 +58,10 @@ Py_DECREF(callable); } +// This "Python function holder" JSClass just exists so that it can hold +// a reference to a Python function for as long as the Python function is +// callable from JS-land. As soon as it's garbage collected by the JS +// interpreter, it releases its reference on the Python function. static JSClass PYM_JS_FunctionHolderClass = { "PymonkeyFunctionHolder", JSCLASS_HAS_RESERVED_SLOTS(1), JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,