javascript - 如何理解javascript错误调试信息

标签 javascript

我在我的应用程序中通过错误消息使用了一个函数。

我这样做是为了识别错误行号和文件位置。

很好,它运行良好,但我对这些行号感到困惑,因为每个行号都有 2 个值。

请查看其中一条相同的错误消息:

Error
    at Object.Core.initAlert (http://localhost/demo/core.js:205:22)
    at http://localhost/demo/app.js:26:10
    at _setImmediate (http://localhost/demo/async.js:182:20)
    at http://localhost/demo/async.js:234:13
    at http://localhost/demo/async.js:113:13
    at _arrayEach (http://localhost/demo/async.js:85:13)
    at _forEachOf (http://localhost/demo/async.js:112:9)
    at _each (http://localhost/demo/async.js:77:13)
    at Object.async.forEachOf.async.eachOf (http://localhost/demo/async.js:233:9)
    at Object.async.forEach.async.each (http://localhost/demo/async.js:210:22)

你可以看到最后一行有两个行号,我在这里很困惑哪一个是函数语句的行号。第一个或第二个。

例如。在第一行:

at Object.Core.initAlert (http://localhost/demo/core.js:205:22)

有205和22

有没有人知道....

或者有没有其他方法可以跟踪 javascript 中的执行堆栈。

最佳答案

第一个数字是行号,第二个数字是列号。

关于javascript - 如何理解javascript错误调试信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31563093/

相关文章:

javascript - 如何替换字符串中的 "is"等单词,而不影响 "Pakistani"|节点js

javascript - 使用 jQuery 生成配置文件预览

javascript - 使用 AngularJS 服务构建 html 部分

javascript - ES6 Method Definition Shorthand 是否只创建一个函数对象?

java - 使用 javascript 重定向到新 URL

javascript - 如何在 Chart.js 中显示工具提示?

javascript - 如何禁用CKEditor的源代码 View ?

javascript - 如何在xmlhttprequest中发送jwt?

javascript - 如何标记与文本混合的单词

javascript - 为什么 table 在以下场景中会分心?