Subj : Re: using js_HashString in a getter callback To : netscape.public.mozilla.jseng From : Sterling Bates Date : Fri May 21 2004 11:28 am Brann Joly wrote: > I would like to be able to store a private pointer somewhere, and to get it > back in my generic getter method, but it seems I can't. The obj parameter in your getter method is the object containing the property. You can use the JS_SetPrivate and JS_GetPrivate methods on that object to set & get your private data. > this raises the following question: Is Id something stable over time, or > should I always use JS_ValueToString ? I'll try this one (could be wrong): the value pointed to by id should not be moved by reallocation, so it should be safe to track id. > > second, i may have different objects with the same property name. in this > case, are both id (i mean the id parameter getting passed to the getter > callback) equals, or are them different, but still returning the same string > when you call JS_ValueToString(id). They'll be different pointers if you set them separately. I think you could try using a prototype, if it fits your code. I don't have enough experience to say one way or the other, so I'll let someone else say for sure :) Sterling .