Subj : How to distinguish objects of the same type in C? To : netscape.public.mozilla.jseng From : Weiyang Zhou Date : Thu Aug 11 2005 01:42 am Hi, If I use JS_initClass to define a class Foo, the contructor will allocate some instance data in C for the object created. I also use JS_DefineFunction to define a function called fooOp(). Assuming the C implementation of this function is fooOp_native(). With the following JavaScript: f1 = new Foo(); f2 = new Foo(); fooOp(f1, f2); In fooOp_native(), I will need to retrieve the instance data from each object. How should I do that? I have read jsdate.c, seems it uses OBJ_SET_SLOT/OBJ_GET_SLOT, but it is not in jsapi.h. Or should I use JS_SetPrivate/JS_GetPrivate? Thank you Weiyang .