Javascript回溯 [英] Javascript backtrace
问题描述
如何在Javascript中获得回溯?
How to I get a backtrace in Javascript?
理想功能:
- 条目函数名称,或匿名函数的一些有意义的标识符,
- 每个级别的参数列表,
- 行号。
这可以在标准ECMAScript中完成吗?
Can this be done in standard ECMAScript?
如果没有,可以在常见的网络浏览器方言?
If not, can it be done in the common web browser dialects?
谢谢。
感谢您的建议。
我的方言不支持 arguments.caller
或 arguments.callee
。
我可以这样做:
try {
let x = null;
x .foo ();
}
catch (e) {
debug (dump (e.stack));
}
它以字符串形式获取信息,这对于a-a是可以接受的-glance,但走路 e.stack
会很有帮助。它有标准表格吗?
Which gets me the information as a string, which is okay for at-a-glance, but it would be a great help to walk e.stack
. Does it have a standard form?
再次感谢。
推荐答案
也许这可能对你有所帮助,但还没有使用它:
maybe this might help you, haven't worked with it yet though:
此链接不再有效:kallewoof.com/2006/03/15/precompiling-javascript -functions /
This link is no longer active: kallewoof.com/2006/03/15/precompiling-javascript-functions/
也看看这个:
这篇关于Javascript回溯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!