Hi,
I know you can do stuff with introspection to gather up passed-in args
for a Javascript function and that you can list all defined functions
like:
function a(abc,xyz,zzz) {
print(arguments[0]); //etc
}
And
for (i in this) {
if (typeof(this[i])=='function') { print(i); }
}
But is there a way of:
Finding all defined functions and returning the parameter list - and
also the 'return' (if any) ?
I would like to iterate over all Javascript objects, and just generate
a 'stub' of each function which I can use to generate documentation
and 'proxy' functions etc ?
Thanks in advance,
John
(examples set up in 'Rhino' Shell, rather than browser, hence 'print'
rather than 'document.write ...' etc).
I know you can do stuff with introspection to gather up passed-in args
for a Javascript function and that you can list all defined functions
like:
function a(abc,xyz,zzz) {
print(arguments[0]); //etc
}
And
for (i in this) {
if (typeof(this[i])=='function') { print(i); }
}
But is there a way of:
Finding all defined functions and returning the parameter list - and
also the 'return' (if any) ?
I would like to iterate over all Javascript objects, and just generate
a 'stub' of each function which I can use to generate documentation
and 'proxy' functions etc ?
Thanks in advance,
John
(examples set up in 'Rhino' Shell, rather than browser, hence 'print'
rather than 'document.write ...' etc).
Comment