Subj : Rhino: Obtaining a list of script functions To : netscape.public.mozilla.jseng From : Attila Szegedi Date : Fri Oct 15 2004 08:13 pm Hi folks, is there a way to obtain a list of all functions that a particular script declares via the "function" keyword? Right now, I can execute the script into an empty NativeObject as a scope and then get the property ids and pick those that implement InterpretedFunction, however the approach has two drawbacks: - if there's a top level statement in the script other than a function declaration, it will likely throw an org.mozilla.javascript.EcmaError: ReferenceError: "" is not defined. Actually, I might circumvent this with a clever Scriptable implementation as the scope... - the approach only returns top-level functions. Ideally, I want to have a map of functions to strings (in case of embedded functions some nice hierarchical naming) and vice versa so I can replace as many functions as possible in serialization with stubs. Any idea appreciated. Cheers, Attila. .