Subj : Re: question about javascript functions To : netscape.public.mozilla.jseng From : Matthew Mondor Date : Mon Feb 14 2005 07:39 pm On Mon, 14 Feb 2005 22:22:27 +0100 "Béatrice Philippe" wrote: > Another question : is there any way to get argument names of a each > javascript function stored in the global object ? i saw i could get > the number of arguments but no names.... Hmm I just ran a little test through the js shell to see if function arguments would be considered properties and could be iterated though: function test(arg1, arg2) { for (;;) ; } for (i in test) print(i + ' = ' + test[i] + "\n"); This suggests that a C function running through the properties after a JS_Enumerate() could retreive the argument names of a function, if working on the function JSObject... A function similar to the one I posted above in the "Iterating through all Array elements from C" would most probably work. Unfortunately, the JSIdArray structure is supposed to be considered private API, according to the reference documentation I read (http://www.mozilla.org/js/spidermonkey/apidoc/gen/api-JSIdArray.html) but it worked for me and I needed the functionality. Matt .