本文介绍了什么时候在window.onError函数上提供正确的堆栈跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多其他编程语言(例如java,ruby)中的异常/错误总是提供stacktrace / backtrace信息。



在JavaScript未处理的错误被window.onError捕获。



虽然该函数没有获取Error对象,所以我们无法访问对象的堆栈属性。



解决方案

有没有关于的可靠信息来源?似乎错误对象本身将是提供给onerror的第五个参数。

- 第7.1.6.1节


Exceptions/Errors in many other programming languages (say java, ruby) always provide stacktrace/backtrace information.

In JavaScript unhandled Errors get caught by window.onError.

Although that function does not get the Error object, so we have no access to the object's stack property.

Is there any reliable source of information about when will there be any change on that?

解决方案

It seems that the error object itself will be the fifth parameter supplied to onerror. http://html5.org/tools/web-apps-tracker?from=8085&to=8086
http://www.whatwg.org/specs/web-apps/current-work/ - section 7.1.6.1

这篇关于什么时候在window.onError函数上提供正确的堆栈跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 03:04