How can I determine which class (or prototype) a particular function is
part of where "function" is a JSFunction *?
If I just do:
JSObject *obj;
obj = JS_GetFunctionObject(function);
if (obj != NULL)
{
className = JS_GetClassName(obj);
}
Then I get "Function" which is not very useful. What I really want is
the name of the prototype for which this function is a member.
One approach I thought of would be to use the function object to get the
"constructor" property, which if non NULL indicates a constructor
exists. If this property is a JSFunction then you could ask for the
function id which would be the name of the class/prototype.
Unfortunately that doesn't work as the value returned from the
constructor property does not appear to a JSFunction * but something
else.
Does anybody know how to do this task?
Thanks
Stephen
--
Stephen Kellett
Object Media Limited http://www.objmedia.demon.co.uk/software.html
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
_______________________________________________
mozilla-embedding mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-embedding