Subj : 'Subclassing' JSClass To : netscape.public.mozilla.jseng From : James Turner Date : Fri Jan 17 2003 09:54 am So, in my ongoing path to SpiderMonkey enlightenment.. I need to associate some extra data with each JSClass* . My options are) a lookup table based on the pointer value (yuck), stashing a pointer in the reserved field of JSClass (liable to break in the future and won't work if sizeof(void*) > sizeof(jsword), which I'm guessing it may be on 64-bit archs ).. Or finally, option c) struct { JSClass inner; // my extra data ... } } ExtendedJSClass; And pass these around to JS_InitClass and friends. Now, obviously I'm currently favoring this last options, so I need to know: is there a better way, and/or is anything likely to break with this method? Eg internal dense arrays of JSClass structs, etc. It seems unlikely from looking at code but I'd like to make sure. Thanks, James .