Subj : Re: dereferenced object To : netscape.public.mozilla.jseng From : Brendan Eich Date : Sat Apr 17 2004 06:43 pm Sterling Bates wrote: > > I think what Brendan means is create a callback for JSClass.getProperty. In > that callback, see if the id parameter is an int via JSVAL_IS_INT(id). If > so, convert id to an int, then get that element from the array (if the array > is JS only, use JS_GetElement). Like this (I think): > > idx = JSVAL_TO_INT(id); > JS_GetElement(cx, myobj, idx, vp); > In Thibaut's case, the myobj variable in your sketch would not be the |obj| formal parameter to childNodes_getProperty -- it would be the "items" array that childNodes.item(i) accesses. /be .