jsdIScript.functionName semantics
"John J. Barton" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Message-ID | <[email protected]> |
The API for jsdIScript includes: --- readonly char* functionName Function name for this script. "anonymous" for unnamed functions (or a function actually named anonymous), empty for top level scripts. This data is copied from the underlying structure when the jsdIScript instance is created and is therefore available even after the script is invalidated. (http://www.xulplanet.com/references/xpcomref/ifaces/jsdIScript.htm) --- Experimentally (in Javascript) this value is false (null I guess) for the script objects in stack frames created by eval(). I'm not sure what "empty" means, but perhaps its means "in Javascript the value will test false". The eval() case is not mentioned in the doc. So would the be correct to say: empty for top level scripts and eval-created scripts. And does that exhaust the possible causes of functionName == null? In other words, is "functionName == null plus a stack frame above the one containing this script" a test for an eval() frame?