Subj : Re: dereferenced object To : netscape.public.mozilla.jseng From : "Thibaut" Date : Fri Apr 16 2004 10:22 pm thanks i'll take a look at that. I'm writing my own implementation because i need to evaluate the javascript on webpages .I want to get links created dynamically by javascript . If you have a better way tell me ! "Brendan Eich" a écrit dans le message de news: 40802004.8000700@meer.net... > Thibaut wrote: > > I'm implementing the dom with spidermonkey. > > i wrote the function specified below and it works fine but i have a problem > > this function is applied to a childNodes object. > > when i want to call item, i write: > > childNodes.item(my_index) > > and it returns me the element at the index "my_index". > > childNodes is an object with the property "liste" which is an ArrayObject > > this is my question : > > i want that when i write childNodes[my_index] it does the same job as > > childNodes.item(my_index) > > How can i do that in spidermonkey ?? > > > Use the JSClass.getProperty hook for childNodes' class. It should > handle id parameters for which JSVAL_IS_INT(id) evaluates to true and > JSVAL_TO_INT(id) is >= 0 and < the length of the array. > > BTW, why are you writing your own DOM implementation? > > /be .