Subj : Re: Using Rhino to report on JS variable/function scoping To : netscape.public.mozilla.jseng From : Brendan Eich Date : Tue Sep 02 2003 11:51 am Mark__e wrote: >I am trying to achieve the following. > >From any given Javascript I need to identify any variables and >functions that have global scope within the context of the Javascript >I am evaluating. > What about variables or functions created using eval? Is it ok if those are not included? In SpiderMonkey, you could parse the source and walk the parse tree yourself, using a "friend" API (subject to change, not frozen but not likely to change in a huge way; no binary compatibility). Or you could compile to a script and then execute the script's prolog bytecodes, which process var, const, and function declarations. /be .