Subj : how to overload setter function, but keeping standard behavior in addition to specific one To : netscape.public.mozilla.jseng From : smaraux Date : Wed Mar 02 2005 10:04 am Hello, I am using an array of js vals attached to a js object via JS_DefineElement function. When these js data are set, I need to apply a specific behavior in addition to the standard one. to summarize : I would like to use a class with this setter : setArrayElement(JSContext *pJSContext, JSObject *pJSObject, jsval id, jsval *pJSSetVal) { //... manipulating private data according to set value ... JS_SetElement(pJSContext, pJSObject, ind, pJSSetVal); } I was hoping the call would not loop, and fall back to standard stub setter when calling the second time JS_SetElement(). Unfortunately, the JS_SetElement call back the setArrayElement, leading to a dead lock. (which is a valid behavior though, I agree) How could I do to keep the standard behavior of set element, added to my custom private data manipulation ? I have taken a look at spidermonkey code, but "standard behavior" seems quite stuck with other SetProperty code, it si not a different function as I expected. Thank you in advance for any advice. .