Subj : Re: dereferenced object To : Thibaut From : Brendan Eich Date : Fri Apr 16 2004 12:03 pm 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 .