Subj : Re: Getting function name with generic function call hook To : netscape.public.mozilla.jseng From : Brendan Eich Date : Tue Oct 28 2003 10:58 am Sterling Bates wrote: > After some searching I think I'm clueing in on what the private attribute > is. If I understand it right, instead of setting a property (say "__addr") > of a JSObject pointing to a memory address, I could simply > JS_SetPrivate(cx,obj,Pointer(self)), and whenever I see a JSObject*, I can > use JS_GetPrivate to retrieve a pointer to the Delphi class instance. See also JS_GetInstancePrivate and JS_InstanceOf. You don't want to assume that an obj parameter to a native function is an instance of a particular class. You don't want to assume all instances have non-null private data, either -- unless you always set non-null private, even for the unconstructed class prototype created and returned by JS_InitClass. /be .