Subj : Re: object serialization To : netscape.public.mozilla.jseng From : Jens Thiele Date : Thu Apr 08 2004 03:02 pm > JS_GetObjectId does not return an id that you can convert into a value. > It is intended for internal use only, not scripted use. Maybe it > should be extended to work as you want it to. Try the attached patch > and let me know how it works. > > /be > > JS_PUBLIC_API(JSBool) > JS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp) > { > - *idp = (jsid) obj; > + *idp = (jsid) obj | JSVAL_INT; > return JS_TRUE; > } currently i use (in my code): ECMA_BEGIN_FUNC(hashObject) { ECMA_CHECK_NUM_ARGS(1); if (!JSVAL_IS_OBJECT(argv[0])) ECMA_ERROR("object required as argument"); JSObject *o=JSVAL_TO_OBJECT(argv[0]); if (!o) return JS_FALSE; *rval=INT_TO_JSVAL(o); return JS_TRUE; } are object pointers guaranteed to remain constant during the lifetime of a object? i will try your patch .