Subj : Re: dereferenced object To : Thibaut From : Brendan Eich Date : Mon Apr 19 2004 11:01 am Thibaut wrote: > i have another problem ... > > my code for the JSClass.getProperty hook is below : > How do i get my array ? my problem is that when i want to get my array > i do : > Js_GetProperty(cx,obj,"my_array",&my_array) > but since i declared the callback function below i can't call > JS_GetProperty(...) because it calls my_getProperty instead ... > my question is : how can i get my array now in the my_getProperty(...) ??? Of course you can't unconditionally call your own my_getProperty function (indirectly via JS_GetProperty), that will recursively diverge. Why are you not using a switch statement on (JSVAL_TO_INT(id)), after checking that JSVAL_IS_INT(id), and special-casing the recursion to happen only for the "tinyid" associated with the identifier "my_array"? > i'm sorry to bother you with all these questions but i'm a bit lost. That's not good -- it will probably be painful for both of us to try to teach more by trial and error. Have you studied the documents at http://www.mozilla.org/js/spidermonkey? Have you read the README.html in the source directory? /be .