问题
Looking at it, Rhino doesn't support the caller
property for functions - does anyone know if there is a branch that allows this, even if just in interpreter mode?
If not, does anyone have any general ideas about how this might be added?
回答1:
Never heard about Function.prototype.caller
in javascript, but there's arguments.callee.caller
, which is really unsupported in Rhino according to the Internet;
If you need to get stack traces, there's an idea for solution: http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino/browse_thread/thread/a8db6d5c4c729f0e/a5f717c02af610ea?pli=1
来源:https://stackoverflow.com/questions/8986828/is-it-possible-to-add-function-caller-support-to-rhino