If you're in interpretive mode, the only API for this information is the
debug API. The information isn't kept for performance reasons unless a
debugger is attached. See org.mozilla.javascript.debug.DebuggableEngine,
methods getFrameCount and getFrame.
--N
Ah, sorry, you've asked twice.
Norris answered for Rhino. I thought you were asking about Spidermonkey.
Brendan might offer a better amswer, but... For a simple stack trace
you can use function.caller...
js> function f(){for(c = arguments.callee; c; c = c.caller){print(c.name);}}
js> function g() {f();}
js> function h() {g();}
js> function i() {h();}
js> i()
f
g
h
i
js>
This gets you the strack trace of the functions, but not access to the call
objects - the arguments objects - of each caller. As I understand things
that is being intensionally hidden from running JS code.
Hope this help,
John.