Subj : Re: using js_HashString in a getter callback To : Brann Joly From : Brendan Eich Date : Mon May 24 2004 11:52 am Brann Joly wrote: > For methods, i'm storing the private data this way : > JSFunction* func = JS_DefineFunction(cx, i->second.first, _decl.name, > jslangage::generic_wrapper, n, 0); > JS_SetPrivate(cx, JS_GetFunctionObject(func), &_decl); Don't you mean JS_SetReservedSlot, not JS_SetPrivate, here? > 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). The engine internalizes ids as atoms, ensuring uniqueness. So a get or set of "foo" will result in the same jsval id being passed every time, no matter how "foo" was computed by the caller. /be .