Subj : Re: object serialization To : Jens Thiele From : Brendan Eich Date : Thu Apr 08 2004 07:32 pm Jens Thiele wrote: > seems to work > i added an assert ;-) > > JS_PUBLIC_API(JSBool) > JS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp) > { > JS_ASSERT( ( (jsid) obj & 7 ) == 0 ); > *idp = (jsid) obj | JSVAL_INT; > return JS_TRUE; > } > > and now use this as hash function (for objects) Checked in for 1.7 final -- I used JSVAL_TAGMASK and canonical spacing around parens in the assertion checked in. Use it in good health. /be .