Firebug 没有显示错误的堆栈跟踪?
我注意到,即使从下拉列表中启用了“显示带有错误的堆栈跟踪”,也只有发生的错误似乎有痕迹,但是当我这样做时:throw new Error('foo' );
我没有看到它的任何堆栈跟踪,尽管它在控制台中的显示方式似乎与发生的其他错误(例如 iDoNotExist()
)完全相同。
我有什么遗漏的吗?
我似乎还获得了调用 console.error('foo');
的堆栈跟踪。奇怪的。
应该注意的是,当执行 throw new Error('foo');
时,Webkit Inspector 和 Opera 上确实会出现堆栈跟踪。
I have noticed that even with "show stack trace with errors" enabled from the drop down, only errors that occur seem to have traces, but when I do: throw new Error('foo');
I do not see any stack trace for it even though it seems to appear in the console exactly the same way as other errors that occur such as iDoNotExist()
.
Is there something I am missing?
It also seems that I get the stack trace for calling console.error('foo');
. Odd.
It should be noted that stack traces do occur on Webkit Inspector and Opera when doing throw new Error('foo');
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于其他登陆此处的人:
对我来说,问题是 Firebug 默认情况下将
showStackTrace
设置为 false。启用它的方法如下:
在 Firefox 中转到
about:config
更改首选项的值
extensions.firebug.showStackTrace
从false
到true
(双击切换值)。For others landing here :
The issue for me was
showStackTrace
is set to false by default for Firebug.Here's how to enable it :
Goto
about:config
in FirefoxChange the value of the preference
extensions.firebug.showStackTrace
fromfalse
totrue
(Double-click toggles the value).我在 Firebug 1.7.1b2(FF:4.0.1,在 win7 上)中测试了这段代码,它显示了堆栈跟踪:
I tested this code in Firebug 1.7.1b2 (FF: 4.0.1, on win7) and it shows me stack trace:
您是否尝试过:
或者甚至(并不总是有效):
Have you tried:
Or even (doesn't always work):