是否可以为 Rhino 添加 Function.caller 支持?
看看它,Rhino 不支持函数的 caller
属性 - 有谁知道是否有一个分支允许这样做,即使只是在解释器模式下?
如果没有,有人对如何添加它有任何一般想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从来没有听说过 javascript 中的
Function.prototype.caller
,但是有arguments.callee.caller
,根据互联网,Rhino 确实不支持它;如果您需要获取堆栈跟踪,有一个解决方案:
http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino/browse_thread/thread/a8db6d5c4c729f0e/a5f717c02af610ea?pli=1
Never heard about
Function.prototype.caller
in javascript, but there'sarguments.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