Subj : Re: using js_HashString in a getter callback To : netscape.public.mozilla.jseng From : Sterling Bates Date : Tue May 25 2004 11:28 am Brann Joly wrote: >>Don't you mean JS_SetReservedSlot, not JS_SetPrivate, here? > > I meant JS_SetPrivate, but of course I may be wrong. What I want is to > attach some data to a function object, so I can get it back when my callback > is called by SM. Since I use JS_SetPrivate to attach private data to > objects, i thought it was a good idea to use it for functions too. What's > the difference between the 2 functions? I can't find JS_SetReservedSlot in > the apidoc In JSClass.reserveSlots you can set up to 255 reserved slots. While there are other reserved slots for the engine internals, you can reference the slots from 0..n-1. Here's the signature for JS_SetReservedSlot: JSBool JS_SetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval v); And the signature for JS_GetReservedSlot: JSBool JS_GetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval *vp); Sterling .